CheckOps
insta
insta is an Apache-2.0 snapshot testing library for Rust by Armin Ronacher, with assert_snapshot! macros, serde-based formats, redactions, inline snapshots and the cargo insta review tool.
Latest public signals
Not refreshed yet. Refresh reads the public site and, when the entry has a GitHub repository, the latest release.
Introduction
insta is a snapshot testing library for Rust created by Armin Ronacher. Snapshot tests assert that a value matches a stored reference; when the output changes, you review the difference and accept or reject it. This is ideal for complex output such as parser ASTs, serialised API responses, CLI output or rendered templates, where writing exact assertions by hand would be tedious.
Macros include assert_snapshot! for strings, assert_debug_snapshot! for Debug output, and serde-based assert_yaml_snapshot!, assert_json_snapshot! and others behind features. Snapshots are stored in .snap files or inline in source code. Redactions replace unstable values such as timestamps or IDs before comparison, and glob support snapshots many input files at once. The companion cargo insta CLI runs tests and offers an interactive cargo insta review workflow to accept or reject changes, and editor extensions are available. Version 1.49.0 was released on 3 October 2026.
The source code is at mitsuhiko/insta on GitHub under the Apache-2.0 licence, with about 3,000 stars; the most recent commit was on 26 October 2026.
Features
- Snapshot macros: String, Debug and serde formats.
- cargo insta review: Interactive accept or reject workflow.
- Redactions: Mask timestamps, IDs and other unstable data.
- Inline snapshots: Keep small snapshots in source code.
Pros
- Free to use: Open source under the Apache-2.0 licence, so the core tool costs nothing to use.
- Actively maintained: The repository had commits as recent as 26 October 2026.
Cons
- Review discipline: Accepting snapshots blindly hides regressions.
- Large diffs: Big snapshots can be hard to review.
Usage and Links (Example)
cargo add --dev insta --features yaml
cargo install cargo-insta
#[test]
fn renders_invoice() {
let invoice = render_invoice(&sample_order());
insta::assert_snapshot!(invoice);
}
#[test]
fn api_response_shape() {
let resp = build_response();
insta::assert_yaml_snapshot!(resp, { ".created_at" => "[timestamp]" });
}
cargo insta test --review
Resources:
Pricing
insta is free and open source under the Apache-2.0 licence.
Recommended for?
- Rust projects with complex outputs such as compilers, CLIs and APIs.
- Teams wanting fast, reviewable regression tests.
Conclusion
insta is the go-to snapshot testing tool for Rust, with an excellent review workflow and flexible formats.
Alternatives
Other tools on CheckOps that cover similar ground. Open a page, or compare one with insta side by side.
Rrstestrstest is an Apache-2.0 fixture-based and parameterised testing framework for Rust, offering pytest-style fixtures, #[case] tables, value matrices and async support on top of cargo test.Compare with insta
Pproptestproptest is a Hypothesis-inspired property-based testing framework for Rust, with composable strategies, automatic shrinking and persisted regression files.Compare with insta
Ccargo-nextestcargo-nextest is an Apache-2.0 next-generation test runner for Rust, up to 3x faster than cargo test per its site, with per-test process isolation, retries, partitioning, JUnit output and a filterset DSL.Compare with insta
MMockallMockall is a powerful mock object library for Rust, generating mocks for traits and structs with the #[automock] attribute or mock! macro, with expectations, predicates and call counts.Compare with insta
JJestJest is a free, open-source JavaScript test runner with zero-config defaults, mocks, and snapshot testing.Compare with insta
SSnapshotTesting (Point-Free)SnapshotTesting is Point-Free's MIT-licensed snapshot testing library for Swift, snapshotting views, view controllers and any value as images, text, JSON and more, with XCTest and Swift Testing support.Compare with insta