diff options
author | Bartek IwaĆczuk <biwanczuk@gmail.com> | 2023-12-18 11:43:27 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-12-18 11:43:27 +0100 |
commit | 5b2caed7fd928fa80e31be47edf0bd73a1b2c1cc (patch) | |
tree | b2852318f035acec936ad3e866ec16153a9cad43 /cli/tests | |
parent | a44a5de43013becb91e4725e508051e62f628467 (diff) |
fix(coverage): error if no files found (#21615)
This commit fixes a panic in `deno coverage` command if the file
to be covered doesn't produce any coverage data.
Fixes https://github.com/denoland/deno/issues/21580
Diffstat (limited to 'cli/tests')
-rw-r--r-- | cli/tests/integration/coverage_tests.rs | 6 | ||||
-rw-r--r-- | cli/tests/testdata/coverage/doesnt_exist.out | 1 |
2 files changed, 7 insertions, 0 deletions
diff --git a/cli/tests/integration/coverage_tests.rs b/cli/tests/integration/coverage_tests.rs index 4c7a51f4e..497d67890 100644 --- a/cli/tests/integration/coverage_tests.rs +++ b/cli/tests/integration/coverage_tests.rs @@ -630,3 +630,9 @@ File | Branch % | Line % | ", ); } + +itest!(no_files_found { + args: "coverage doesnt_exist.js", + exit_code: 1, + output: "coverage/doesnt_exist.out", +}); diff --git a/cli/tests/testdata/coverage/doesnt_exist.out b/cli/tests/testdata/coverage/doesnt_exist.out new file mode 100644 index 000000000..0b679bcb4 --- /dev/null +++ b/cli/tests/testdata/coverage/doesnt_exist.out @@ -0,0 +1 @@ +error: No coverage files found |