From 4f5885e45a518e3911211bfd59a304ff7cca4a4d Mon Sep 17 00:00:00 2001 From: Pietro Marchini Date: Sun, 8 Dec 2024 21:39:21 +0100 Subject: [PATCH 1/5] test_runner: exclude test files from coverage by default --- doc/api/cli.md | 3 + doc/api/test.md | 7 +- lib/internal/test_runner/coverage.js | 36 ++++++-- lib/internal/test_runner/utils.js | 5 ++ .../test-runner/output/lcov_reporter.js | 11 ++- .../test-runner-coverage-source-map.js | 6 +- .../test-runner-coverage-thresholds.js | 6 ++ test/parallel/test-runner-coverage.js | 89 ++++++++++++++++--- test/parallel/test-runner-output.mjs | 29 +++--- 9 files changed, 157 insertions(+), 35 deletions(-) diff --git a/doc/api/cli.md b/doc/api/cli.md index 2002a99654c1e0..2643698443db8d 100644 --- a/doc/api/cli.md +++ b/doc/api/cli.md @@ -2291,6 +2291,9 @@ This option may be specified multiple times to exclude multiple glob patterns. If both `--test-coverage-exclude` and `--test-coverage-include` are provided, files must meet **both** criteria to be included in the coverage report. +By default all the matching test files are excluded from the coverage report. +Specifying this option will override the default behavior. + ### `--test-coverage-functions=threshold`