From 00e250241bcad56a0fdaf30fcc54057648d546f9 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 --- CHANGELOG.md | 1 + README.md | 21 +++++++++++++++++++++ 2 files changed, 22 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index a189092..59d754e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -20,6 +20,7 @@ Rust 1.70 * Add up/down hooks to run custom Rust code during migrations ([PR](https://github.com/cljoly/rusqlite_migration/pull/28) thanks to [@matze](https://github.com/matze)) * Add foreign_key_check method to migrations ([PR](https://github.com/cljoly/rusqlite_migration/pull/20) thanks to [@Jokler](https://github.com/Jokler)) * Make `Migration` functions const ([PR](https://github.com/cljoly/rusqlite_migration/pull/19) thanks to [@fkaa](https://github.com/fkaa)) +* Make `Migrations` serializable (using the Debug serializer) with insta. ### Depreciation 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.