From 8bc8b52959b6bbb401f7c27c1c018474be1fc932 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Joly?= Date: Thu, 7 Dec 2023 21:36:50 +0000 Subject: [PATCH] doc: mention cargo-insta in the Readme Call out: * Use of the library with insta (insta.rs) * Useful caro tools to install to debug failing CI --- README.md | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/README.md b/README.md index e651fdc..4365fc0 100644 --- a/README.md +++ b/README.md @@ -106,6 +106,20 @@ fn migrations_test() { } ``` +The migrations object is also suitable for serialisation with [insta][], using the `Debug` serialisation. You can store a snapshot of your migrations like this: + +```rust +#[test] +fn migrations_insta_snapshot() { + let migrations = Migrations::new(vec![ + // ... + ]); + insta::assert_debug_snapshot!(migrations); +} +``` + +[insta]: https://insta.rs/ + ## Optional Features Rusqlite_migration provides several [Cargo features][cargo_features]. They are: @@ -128,6 +142,13 @@ A number of contributors are also reporting issues as they arise, another indica Contributions (documentation or code improvements in particular) are welcome, see [contributing](https://cj.rs/docs/contribute/)! +We use various tools for testing that you may find helpful to install locally (e.g. to fix failing CI checks): +* [cargo-insta][] +* [cargo-mutants][] + +[cargo-insta]: https://crates.io/crates/cargo-insta +[cargo-mutants]: https://mutants.rs/installation.html + ## Acknowledgments I would like to thank all the contributors, as well as the authors of the dependencies this crate uses.