Skip to content

Commit

Permalink
test: fix snapshot testing for ci (#62)
Browse files Browse the repository at this point in the history
* test: fix snapshot testing for ci

Signed-off-by: simonsan <14062932+simonsan@users.noreply.github.com>

* snapshot update

Signed-off-by: simonsan <14062932+simonsan@users.noreply.github.com>

* snapshot update

Signed-off-by: simonsan <14062932+simonsan@users.noreply.github.com>

* snapshot update

Signed-off-by: simonsan <14062932+simonsan@users.noreply.github.com>

---------

Signed-off-by: simonsan <14062932+simonsan@users.noreply.github.com>
  • Loading branch information
simonsan authored Mar 1, 2024
1 parent c9f902d commit 1639098
Show file tree
Hide file tree
Showing 6 changed files with 128 additions and 68 deletions.
2 changes: 1 addition & 1 deletion .justfile
Original file line number Diff line number Diff line change
Expand Up @@ -147,4 +147,4 @@ update-scoop-manifest *ARGS:

# Run insta tests in review mode
insta:
cargo insta test --review
cargo insta test --review --workspace
119 changes: 119 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions crates/core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ typed-builder = "0.18.1"
ulid = { version = "1.1.2", features = ["serde"] }

[dev-dependencies]
insta = { version = "1.35.1", features = ["toml", "redactions"] }
rstest = "0.18.2"
similar-asserts = { workspace = true }

Expand Down
13 changes: 7 additions & 6 deletions tests/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,13 +57,14 @@ fn test_version_command_passes() -> TestResult<()> {
}

#[test]
fn test_subcommand_not_provided_snapshot_passes() {
assert_cmd_snapshot!(StdCommand::new(env!("CARGO_BIN_EXE_pace")));
}
fn test_help_command_passes() -> TestResult<()> {
_ = pace_runner()?
.arg("--help")
.assert()
.success()
.stdout(predicate::str::contains("Usage:"));

#[test]
fn test_help_snapshot_passes() {
assert_cmd_snapshot!(StdCommand::new(env!("CARGO_BIN_EXE_pace")).arg("help"));
Ok(())
}

#[test]
Expand Down
44 changes: 0 additions & 44 deletions tests/snapshots/cli__help_snapshot_passes.snap

This file was deleted.

17 changes: 0 additions & 17 deletions tests/snapshots/cli__subcommand_not_provided_snapshot_passes.snap

This file was deleted.

0 comments on commit 1639098

Please sign in to comment.