41 releases (21 breaking)

✓ Uses Rust 2018 edition

0.22.0 Nov 11, 2019
0.20.0 Jul 29, 2019
0.17.0 Mar 25, 2019
0.14.1 Dec 21, 2018
0.1.4 Jan 11, 2016

#7 in Testing

Download history 2446/week @ 2019-10-13 2479/week @ 2019-10-20 3042/week @ 2019-10-27 4031/week @ 2019-11-03 3757/week @ 2019-11-10 4166/week @ 2019-11-17 3078/week @ 2019-11-24 4699/week @ 2019-12-01 5303/week @ 2019-12-08 4908/week @ 2019-12-15 1427/week @ 2019-12-22 2856/week @ 2019-12-29 5360/week @ 2020-01-05 5673/week @ 2020-01-12 6016/week @ 2020-01-19

15,143 downloads per month
Used in 70 crates (69 directly)

MIT and maybe MPL-2.0

70KB
1K SLoC

HTTP mocking for Rust!

Get it on crates.io.

Documentation available at https://docs.rs/mockito.

Before upgrading, make sure to check out the changelog.

Contribution Guidelines

  1. Check the existing issues and pull requests.
  2. One commit is one feature - consider squashing.
  3. :shipit:

Development

Run tests:

cargo test

Run clippy

rustup component add clippy-preview
touch src/lib.rs  # Touch the file to force cargo to rerun clippy on the project
cargo clippy --lib --tests --all-features -- -D clippy::pedantic -D clippy::nursery

Release:

cargo package && cargo publish

Run benchmarks:

rustup install nightly
rustup run nightly cargo bench

Debug output from tests

In your project, add env_logger crate, and init it before each test:

#[test]
fn example_test() {
    let _ = env_logger::try_init();
    /**/
}

and run tests with:

RUST_LOG=mockito=debug cargo test

Logo courtesy to http://niastudio.net 👌

Dependencies

~3MB
~67K SLoC