Skip to content

Commit

Permalink
Document use without cargo-insta
Browse files Browse the repository at this point in the history
  • Loading branch information
mitsuhiko committed May 15, 2024
1 parent be22494 commit 23d0e4d
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions insta/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,28 @@
//! $ cargo insta review
//! ```
//!
//! # Use Without `cargo-insta`
//!
//! Note that `cargo-insta` is entirely optional. You can also just use insta
//! directly from `cargo test` and control it via the `INSTA_UPDATE` environment
//! variable. The default is `auto` which will write all new snapshots into
//! `.snap.new` files if no CI is detected so that `cargo-insta` can pick them
//! up. The following other modes are possible:
//!
//! - `auto`: the default. `no` for CI environments or `new` otherwise
//! - `always`: overwrites old snapshot files with new ones unasked
//! - `unseen`: behaves like `always` for new snapshots and `new` for others
//! - `new`: write new snapshots into `.snap.new` files
//! - `no`: does not update snapshot files at all (just runs tests)
//!
//! You can for instance first run the tests and not write and new snapshots, and
//! if you like them run the tests again and update them:
//!
//! ```
//! INSTA_UPDATE=no cargo test
//! INSTA_UPDATE=always cargo test
//! ```
//!
//! # Assertion Macros
//!
//! This crate exports multiple macros for snapshot testing:
Expand Down

0 comments on commit 23d0e4d

Please sign in to comment.