Skip to content

Commit

Permalink
doc: mention cargo-insta in the Readme
Browse files Browse the repository at this point in the history
Call out:
* Use of the library with insta (insta.rs)
* Useful caro tools to install to debug failing CI
  • Loading branch information
cljoly committed Dec 10, 2023
1 parent 00f917a commit 00e2502
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
21 changes: 21 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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.
Expand Down

0 comments on commit 00e2502

Please sign in to comment.