6 releases

new 0.2.5-alpha Apr 17, 2025
0.2.4-alpha Mar 18, 2025

#338 in Testing

Download history 370/week @ 2025-03-12 181/week @ 2025-03-19 50/week @ 2025-03-26 72/week @ 2025-04-02 8/week @ 2025-04-09

318 downloads per month

Apache-2.0

74KB
2K SLoC

default-monochrome

A minimal crate for mocking HTTP and gRPC servers in Rust, with native support for streaming.

Crates.io Documentation Crates.io

Table of contents

Features

  • Mocks HTTP and gRPC servers
  • Mocks defined in Rust using a simple, ergonomic API
  • Supports HTTP streaming
  • Supports gRPC unary, client-streaming, server-streaming, and bidirectional-streaming methods
  • Match requests to mock responses using built-in matchers or custom matchers

Getting Started

  1. Add mocktail to Cargo.toml as a development dependency:

    [dev-dependencies]
    mocktail = { git = "https://github.com/IBM/mocktail.git", version = "0.2.4-alpha" }
    
  2. For now, see examples in the mocktail-tests crate. Additional documentation coming soon.

Examples

See examples in the mocktail-tests crate.

Related projects

This crate takes inspiration from other great mocking libraries including:

Dependencies

~10–21MB
~280K SLoC