feat(cli): add --coverage flag to deno run command (#29329)

closes #16440

This PR adds `--coverage` flag to `deno run` command. When the flag is
specified, it generates the coverage profile in the directory specified
(default is `coverage`). The coverage directory can also be specified
from the env var `DENO_COVERAGE_DIR`.

---------

Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
This commit is contained in:
Yoshiya Hinosawa 2025-06-25 20:34:30 +09:00 committed by GitHub
parent bff09506bd
commit 56d7660ee4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 142 additions and 0 deletions

View file

@ -579,6 +579,7 @@ fn filter_coverages(
|| e.url.starts_with("data:")
|| e.url.ends_with("__anonymous__")
|| e.url.ends_with("$deno$test.mjs")
|| e.url.ends_with("$deno$stdin.mts")
|| e.url.ends_with(".snap")
|| is_supported_test_path(Path::new(e.url.as_str()))
|| doc_test_re.is_match(e.url.as_str())