From 3a0fcbb17a6dc37ac7463c01cdc0d633e4ac026b Mon Sep 17 00:00:00 2001 From: Aviv Keller <38299977+RedYetiDev@users.noreply.github.com> Date: Sun, 14 Jul 2024 18:37:45 -0400 Subject: [PATCH] test_runner: support glob matching coverage files PR-URL: https://github.com/nodejs/node/pull/53553 Reviewed-By: Moshe Atlow Reviewed-By: Colin Ihrig Reviewed-By: James M Snell Reviewed-By: Benjamin Gruenbaum --- doc/api/cli.md | 36 +++++++++++ doc/api/test.md | 5 -- doc/node.1 | 6 ++ lib/internal/test_runner/coverage.js | 45 +++++++++---- src/node_options.cc | 8 +++ src/node_options.h | 2 + test/parallel/test-runner-coverage.js | 93 +++++++++++++++++++++++++++ 7 files changed, 179 insertions(+), 16 deletions(-) diff --git a/doc/api/cli.md b/doc/api/cli.md index b8e8942f531893..6d80ae4ebe31f1 100644 --- a/doc/api/cli.md +++ b/doc/api/cli.md @@ -490,6 +490,40 @@ For example, to run a module with "development" resolutions: node -C development app.js ``` +### `--test-coverage-exclude` + + + +> Stability: 1 - Experimental + +Excludes specific files from code coverage using a glob pattern, which can match +both absolute and relative file paths. + +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. + +### `--test-coverage-include` + + + +> Stability: 1 - Experimental + +Includes specific files in code coverage using a glob pattern, which can match +both absolute and relative file paths. + +This option may be specified multiple times to include 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. + ### `--cpu-prof`