From d80987db6dcda1869f22f09b36f2bdea77fec25e Mon Sep 17 00:00:00 2001 From: Armin Ronacher Date: Sat, 26 Mar 2022 14:44:49 -0700 Subject: [PATCH] Mention cargo insta test in assertion --- CHANGELOG.md | 1 + src/runtime.rs | 9 +++++++++ 2 files changed, 10 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index df632aac..60a88194 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,7 @@ All notable changes to insta and cargo-insta are documented here. moved since the time of the snapshot creation. (#220) - `cargo insta test` now returns non zero status code when snapshots are left for review. (#222) +- Assertion failures now mention `cargo insta test`. (#223) ## 1.13.0 diff --git a/src/runtime.rs b/src/runtime.rs index b3a75aa7..451aaade 100644 --- a/src/runtime.rs +++ b/src/runtime.rs @@ -388,6 +388,15 @@ fn finalize_assertion(ctx: &SnapshotAssertionContext, update_result: SnapshotUpd } if update_result != SnapshotUpdate::InPlace && !force_pass() { + if get_output_behavior() != OutputBehavior::Nothing { + println!( + "{hint}", + hint = style( + "Stopped on the first failure. Run `cargo insta test` to run all snapshots." + ) + .dim(), + ); + } panic!( "snapshot assertion for '{}' failed in line {}", ctx.snapshot_name