diff options
author | Yoshiya Hinosawa <stibium121@gmail.com> | 2024-05-28 12:37:30 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-05-28 12:37:30 +0900 |
commit | d99c6c1ea4f5711c3f48c5617d7224852fb294d2 (patch) | |
tree | 2d333b2d4636539d52c85245b68df5455a09a355 /tests/integration/coverage_tests.rs | |
parent | c4211e2ffceaa01ebeeab0a3b16809dd8e08667b (diff) |
fix(coverage): handle ignore patterns (#23974)
closes #23972
Diffstat (limited to 'tests/integration/coverage_tests.rs')
-rw-r--r-- | tests/integration/coverage_tests.rs | 45 |
1 files changed, 36 insertions, 9 deletions
diff --git a/tests/integration/coverage_tests.rs b/tests/integration/coverage_tests.rs index f6011b054..c1e5055da 100644 --- a/tests/integration/coverage_tests.rs +++ b/tests/integration/coverage_tests.rs @@ -547,14 +547,15 @@ fn test_summary_reporter() { output.assert_exit_code(0); output.skip_output_check(); - let output = context - .new_command() - .args_vec(vec!["coverage".to_string(), format!("{}/", tempdir)]) - .run(); - - output.assert_exit_code(0); - output.assert_matches_text( - "---------------------------------- + { + let output = context + .new_command() + .args_vec(vec!["coverage".to_string(), format!("{}/", tempdir)]) + .run(); + + output.assert_exit_code(0); + output.assert_matches_text( + "---------------------------------- File | Branch % | Line % | ---------------------------------- bar.ts | 0.0 | 57.1 | @@ -565,7 +566,33 @@ File | Branch % | Line % | All files | 40.0 | 61.0 | ---------------------------------- ", - ); + ); + } + + // test --ignore flag works + { + let output = context + .new_command() + .args_vec(vec![ + "coverage".to_string(), + format!("{}/", tempdir), + "--ignore=**/bar.ts,**/quux.ts".to_string(), + ]) + .run(); + + output.assert_exit_code(0); + output.assert_matches_text( + "--------------------------------- +File | Branch % | Line % | +--------------------------------- + baz/qux.ts | 100.0 | 100.0 | + foo.ts | 50.0 | 76.9 | +--------------------------------- + All files | 66.7 | 85.0 | +--------------------------------- +", + ); + } } #[test] |