Skip to content

Commit

Permalink
Deprecate --no-force-pass (#513)
Browse files Browse the repository at this point in the history
  • Loading branch information
max-sixty authored Aug 8, 2024
1 parent d88ca89 commit 2ec44f2
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
5 changes: 4 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ All notable changes to insta and cargo-insta are documented here.

- Added support for compact debug snapshots (`assert_compact_debug_snapshot`). #514

- Deprecate `--no-force-pass` in `cargo-insta`. The `--check` option covers the
same functionality and has a clearer name. #513

- Inline snapshots now use the required number of `#`s to escape the snapshot
value, rather than always using `###`. This allows snapshotting values which
themselves contain `###`. If there are no existing `#` characters in the
Expand Down Expand Up @@ -38,7 +41,7 @@ All notable changes to insta and cargo-insta are documented here.

- Fixed a bug that caused snapshot and module names to sometimes be inaccurate. #483

- Insta will no longer error when removing snapshots that were already removed. #484
- Insta will no longer error when attempting to remove snapshots that were already removed. #484

- Added support for trailing commas in inline snapshots. #472

Expand Down
9 changes: 7 additions & 2 deletions cargo-insta/src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -213,8 +213,8 @@ struct TestCommand {
/// Delete unreferenced snapshots after a successful test run.
#[arg(long, hide = true)]
delete_unreferenced_snapshots: bool,
/// Disable force-passing of snapshot tests
#[arg(long)]
/// Disable force-passing of snapshot tests (deprecated)
#[arg(long, hide = true)]
no_force_pass: bool,
#[command(flatten)]
target_args: TargetArgs,
Expand Down Expand Up @@ -893,6 +893,11 @@ fn prepare_test_runner<'snapshot_ref>(
}
if !cmd.no_force_pass {
proc.env("INSTA_FORCE_PASS", "1");
} else {
eprintln!(
"{}: `--no-force-pass` is deprecated. Please use --check to immediately raise an error on any non-matching snapshots.",
style("warning").bold().yellow()
);
}
proc.env(
"INSTA_UPDATE",
Expand Down

0 comments on commit 2ec44f2

Please sign in to comment.