insta

A snapshot testing library for rust

Latest version: 1.47.2 registry icon
Maintenance score
100
Safety score
100
Popularity score
90
Check your open source dependency risks. Get immediate insight about security, stability and licensing risks.
Security
  Vulnerabilities
Version Suggest Low Medium High Critical
1.47.2 0 0 0 0 0
1.47.1 0 0 0 0 0
1.47.0 0 0 0 0 0
1.46.3 0 0 0 0 0
1.46.2 0 0 0 0 0
1.46.1 0 0 0 0 0
1.46.0 0 0 0 0 0
1.45.1 0 0 0 0 0
1.45.0 0 0 0 0 0
1.44.3 0 0 0 0 0
1.44.2 0 0 0 0 0
1.44.1 0 0 0 0 0
1.44.0 0 0 0 0 0
1.43.2 0 0 0 0 0
1.43.1 0 0 0 0 0
1.43.0 0 0 0 0 0
1.42.2 0 0 0 0 0
1.42.1 0 0 0 0 0
1.42.0 0 0 0 0 0
1.41.1 0 0 0 0 0
1.41.0 0 0 0 0 0
1.40.0 0 0 0 0 0
1.39.0 0 0 0 0 0
1.38.0 0 0 0 0 0
1.37.0 0 0 0 0 0
1.36.1 0 0 0 0 0
1.36.0 0 0 0 0 0
1.35.1 0 0 0 0 0
1.35.0 0 0 0 0 0
1.34.0 0 0 0 0 0
1.33.0 0 0 0 0 0
1.32.0 0 0 0 0 0
1.31.0 0 0 0 0 0
1.30.0 0 0 0 0 0
1.29.0 0 0 0 0 0
1.28.0 0 0 0 0 0
1.26.0 0 0 0 0 0
1.24.1 0 0 0 0 0
1.24.0 0 0 0 0 0
1.23.0 0 0 0 0 0
1.22.0 0 0 0 0 0
1.21.2 0 0 0 0 0
1.21.1 0 0 0 0 0
1.21.0 0 0 0 0 0
1.20.0 0 0 0 0 0
1.19.1 0 0 0 0 0
1.19.0 0 0 0 0 0
1.18.2 0 0 0 0 0
1.18.1 0 0 0 0 0
1.18.0 0 0 0 0 0
1.17.2 0 0 0 0 0
1.17.1 0 0 0 0 0
1.17.0 0 0 0 0 0
1.16.0 0 0 0 0 0
1.15.0 0 0 0 0 0
1.14.1 0 0 0 0 0
1.14.0 0 0 0 0 0
1.13.0 0 0 0 0 0
1.12.0 0 0 0 0 0
1.11.0 0 0 0 0 0
1.10.0 0 0 0 0 0
1.9.0 0 0 0 0 0
1.8.0 0 0 0 0 0
1.7.2 0 0 0 0 0
1.7.1 0 0 0 0 0
1.7.0 0 0 0 0 0
1.6.3 0 0 0 0 0
1.6.2 0 0 0 0 0
1.6.1 0 0 0 0 0
1.6.0 0 0 0 0 0
1.5.3 0 0 0 0 0
1.5.2 0 0 0 0 0
1.5.1 0 0 0 0 0
1.5.0 0 0 0 0 0
1.4.0 0 0 0 0 0
1.3.0 0 0 0 0 0
1.2.0 0 0 0 0 0
1.1.0 0 0 0 0 0
1.0.0 0 0 0 0 0
0.16.1 0 0 0 0 0
0.16.0 0 0 0 0 0
0.15.0 0 0 0 0 0
0.14.0 0 0 0 0 0
0.13.1 0 0 0 0 0
0.13.0 0 0 0 0 0
0.12.0 0 0 0 0 0
0.11.0 0 0 0 0 0
0.10.1 0 0 0 0 0
0.10.0 0 0 0 0 0
0.9.0 0 0 0 0 0
0.8.2 0 0 0 0 0
0.8.1 0 0 0 0 0
0.8.0 0 0 0 0 0
0.7.4 0 0 0 0 0
0.7.3 0 0 0 0 0
0.7.2 0 0 0 0 0
0.7.1 0 0 0 0 0
0.7.0 0 0 0 0 0
0.6.3 0 0 0 0 0
0.6.2 0 0 0 0 0
0.6.1 0 0 0 0 0
0.6.0 0 0 0 0 0
0.5.4 0 0 0 0 0
0.5.3 0 0 0 0 0
0.5.2 0 0 0 0 0
0.5.1 0 0 0 0 0
0.5.0 0 0 0 0 0
0.4.1 0 0 0 0 0
0.4.0 0 0 0 0 0
0.3.0 0 0 0 0 0
0.2.2 0 0 0 0 0
0.2.1 0 0 0 0 0
0.2.0 0 0 0 0 0
0.1.4 0 0 0 0 0
0.1.3 0 0 0 0 0
0.1.2 0 0 0 0 0
0.1.1 0 0 0 0 0
0.1.0 0 0 0 0 0

Stability
Latest release:

1.47.2 - This version is safe to use because it has no known security vulnerabilities at this time. Find out if your coding project uses this component and get notified of any reported security vulnerabilities with Meterian-X Open Source Security Platform

Licensing

Maintain your licence declarations and avoid unwanted licences to protect your IP the way you intended.

Apache-2.0   -   Apache License 2.0

Not a wildcard

Not proprietary

OSI Compliant



insta: a snapshot testing library for Rust

Crates.io License Documentation VSCode Extension

Introduction

Snapshots tests (also sometimes called approval tests) are tests that assert values against a reference value (the snapshot). This is similar to how 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.

Example

#[test]
fn test_hello_world() {
    insta::assert_debug_snapshot!(vec![1, 2, 3]);
}

Curious? There is a screencast that shows the entire workflow: watch the insta introduction screencast. Or if you're not into videos, read the 5 minute introduction.

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.

Editor Support

For looking at .snap files there is a vscode extension which can syntax highlight snapshot files, review snapshots and more. It can be installed from the marketplace: view on marketplace.

jump to definition

Diffing

Insta uses 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:

use similar_asserts::assert_eq;

fn main() {
    let reference = vec![1, 2, 3, 4];
    assert_eq!(reference, (0..4).collect::<Vec<_>>());
}

Sponsor

If you like the project and find it useful you can become a sponsor.

License and Links