From ffba52abb6b2fa219a1bcef2b4cef3e47ea97d26 Mon Sep 17 00:00:00 2001 From: Aviv Keller <38299977+RedYetiDev@users.noreply.github.com> Date: Tue, 27 Aug 2024 15:11:04 -0400 Subject: [PATCH] doc: fix information about including coverage files PR-URL: https://github.com/nodejs/node/pull/54527 Reviewed-By: Moshe Atlow Reviewed-By: Benjamin Gruenbaum Reviewed-By: James M Snell Reviewed-By: Colin Ihrig --- doc/api/test.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/doc/api/test.md b/doc/api/test.md index 2fde073b74dc3d..34cb65fd85d313 100644 --- a/doc/api/test.md +++ b/doc/api/test.md @@ -431,7 +431,8 @@ command-line flag, code coverage is collected and statistics are reported once all tests have completed. If the [`NODE_V8_COVERAGE`][] environment variable is used to specify a code coverage directory, the generated V8 coverage files are written to that directory. Node.js core modules and files within -`node_modules/` directories are not included in the coverage report. If +`node_modules/` directories are, by default, not included in the coverage report. +However, they can be explicity included via the [`--test-coverage-include`][] flag. If coverage is enabled, the coverage report is sent to any [test reporters][] via the `'test:coverage'` event. @@ -3268,6 +3269,7 @@ Can be used to abort test subtasks when the test has been aborted. [`--experimental-test-coverage`]: cli.md#--experimental-test-coverage [`--import`]: cli.md#--importmodule [`--test-concurrency`]: cli.md#--test-concurrency +[`--test-coverage-include`]: cli.md#--test-coverage-include [`--test-name-pattern`]: cli.md#--test-name-pattern [`--test-only`]: cli.md#--test-only [`--test-reporter-destination`]: cli.md#--test-reporter-destination