Skip to content

Commit

Permalink
Fix test_runner in config (#544)
Browse files Browse the repository at this point in the history
  • Loading branch information
max-sixty authored Aug 2, 2024
1 parent 204b8be commit 527aed7
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion cargo-insta/src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -610,8 +610,15 @@ fn test_run(mut cmd: TestCommand, color: ColorWhen) -> Result<(), Box<dyn Error>
cmd.unreferenced = UnreferencedSnapshots::Delete;
}

// Prioritize the command line over the tool config
let test_runner = match cmd.test_runner {
TestRunner::Auto => loc.tool_config.test_runner(),
TestRunner::CargoTest => TestRunner::CargoTest,
TestRunner::Nextest => TestRunner::Nextest,
};

let (mut proc, snapshot_ref_file, prevents_doc_run) =
prepare_test_runner(cmd.test_runner, cmd.unreferenced, &cmd, color, &[], None)?;
prepare_test_runner(test_runner, cmd.unreferenced, &cmd, color, &[], None)?;

if !cmd.keep_pending {
process_snapshots(true, None, &loc, Some(Operation::Reject))?;
Expand Down

0 comments on commit 527aed7

Please sign in to comment.