Snapshots tests (also sometimes called approval tests) are tests that
assert values against a reference value (the snapshot). This is similar
assert_eq! lets you compare a value against a reference value but
unlike simple string assertions, snapshot tests let you test against complex
values and come with comprehensive tools to review changes.
Snapshot tests are particularly useful if your reference values are very large or change often.
Insta also supports inline snapshots which are stored right in your source file instead of separate files. This is accomplished by the companion cargo-insta tool.
similar for all its diffing
operations. You can use it independently of insta. You can use the
similar-asserts crate to get
inline diffs for the standard
assert_eq! macro to achieve insta like diffs
for regular comparisons:
If you like the project and find it useful you can become a sponsor.