Skip to content

Commit

Permalink
Add test for --ignore-comments option
Browse files Browse the repository at this point in the history
  • Loading branch information
Wilfred committed Jul 27, 2023
1 parent 448972f commit de0e1f5
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions tests/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,18 @@ fn has_changes_requested_exit_code() {
cmd.assert().failure().code(1);
}

#[test]
fn ignore_comments() {
let mut cmd = Command::cargo_bin("difft").unwrap();

cmd.arg("--ignore-comments")
.arg("sample_files/comma_and_comment_before.js")
.arg("sample_files/comma_and_comment_after.js");

let predicate_fn = predicate::str::contains("No syntactic changes");
cmd.assert().stdout(predicate_fn);
}

#[test]
fn check_only() {
let mut cmd = Command::cargo_bin("difft").unwrap();
Expand Down

0 comments on commit de0e1f5

Please sign in to comment.