You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Linux razz 5.15.153.1-microsoft-standard-WSL2 #1 SMP Fri Mar 29 23:14:13 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux
Subsystem
Other
Description
If I have two files, add.js and subtract.js along with tests for just one of them add.test.js which imports add.js I would like the --experimental-test-coverage to report that I have only tested 50% of files.
I've tried using --test-coverage-include='*.js' but this does not seem to include the additional files, I've also tried changing the test pattern node --test *.js which does seem to sort-of work, but it adds extra processing for every file (~1s per file) and logs it as a test suite file in the console, which is undesirable.
Is there a way to make sure coverage reports across all files with a given pattern?
Node.js Version
v22.9.0
NPM Version
v10.8.3
Operating System
Linux razz 5.15.153.1-microsoft-standard-WSL2 #1 SMP Fri Mar 29 23:14:13 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux
Subsystem
Other
Description
If I have two files,
add.js
andsubtract.js
along with tests for just one of themadd.test.js
which importsadd.js
I would like the--experimental-test-coverage
to report that I have only tested 50% of files.I've tried using
--test-coverage-include='*.js'
but this does not seem to include the additional files, I've also tried changing the test patternnode --test *.js
which does seem to sort-of work, but it adds extra processing for every file (~1s per file) and logs it as a test suite file in the console, which is undesirable.Is there a way to make sure coverage reports across all files with a given pattern?
Minimal Reproduction
https://github.com/swantzter/poc-node-test-coverage
Output
Given the three files above, run
node --test --experimental-test-coverage --test-coverage-include='*.js' --test-coverage-exclude='*.test.js'
This prints
I would expect, or am trying to find a way to make it print
Before You Submit
The text was updated successfully, but these errors were encountered: