Mocking in Rust: Mockall and alternatives

This page summarizes the projects mentioned and recommended in the original post on dev.to

InfluxDB high-performance time series database
Collect, organize, and act on massive volumes of high-resolution data to power real-time intelligent systems.
influxdata.com
featured
CodeRabbit: AI Code Reviews for Developers
Revolutionize your code reviews with AI. CodeRabbit offers PR summaries, code walkthroughs, 1-click suggestions, and AST-based analysis. Boost productivity and code quality across all major languages with each PR.
coderabbit.ai
featured
  1. mockers

    Mocking library for Rust

    Mockers was inspired by the Google Mock library for C++. Mockers has an efficient syntax that supports stable Rust; however, you can only use some features in nightly Rust (like generic functions).

  2. InfluxDB

    InfluxDB high-performance time series database. Collect, organize, and act on massive volumes of high-resolution data to power real-time intelligent systems.

    InfluxDB logo
  3. mock_derive

    A mocking library for Rust-lang

    Mock Derive is useful in simplifying the mocking process. It lets you set up unit tests even when using another testing system, like cargo test.

  4. galvanic-mock

    A mocking framework for Rust

    Galvanic-mock is a behavior-driven mocking library. It is part of the testing libraries that work with galvanic-test and galvanic-assert.

  5. pseudo

    A small mocking library for Rust

    Pseudo is a small mocking library. It provides exactly what you need for mocking, and nothing more. Here are some things you can do with Pseudo:

  6. wiremock-rs

    HTTP mocking to test Rust applications.

    Wiremock provides mocking services for applications that interact with HTTP APIs. With Wiremock, you can create mock HTTP servers for testing.

  7. faux

    Struct mocking library for Rust

    Faux allows you to create mock versions of a struct without complicating your code. Like many mocking libraries, faux is only recommended for testing purposes. Mock objects in production may be unstable and cause production problems.

  8. mry

    A simple mocking library for structs, traits, and function.

    Mry allows you to easily create mock objects for unit testing. You can integrate Mry with any testing framework for Rust. Including the inbuilt testing framework, cargo test.

  9. CodeRabbit

    CodeRabbit: AI Code Reviews for Developers. Revolutionize your code reviews with AI. CodeRabbit offers PR summaries, code walkthroughs, 1-click suggestions, and AST-based analysis. Boost productivity and code quality across all major languages with each PR.

    CodeRabbit logo
NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts

  • Mocking Crates Experience

    1 project | /r/rust | 5 Jan 2023
  • Mocking trait object without a library

    1 project | /r/rust | 16 Aug 2021
  • faux: a struct mocking library - landing v0.1

    1 project | /r/rust | 19 Apr 2021
  • The best way for testing outbound API calls

    6 projects | dev.to | 6 Feb 2025
  • Testando chamadas para APIs da melhor forma

    7 projects | dev.to | 6 Feb 2025

Did you know that Rust is
the 5th most popular programming language
based on number of references?