Version
24.15.0
Platform
Subsystem
No response
What steps will reproduce the bug?
Run --experimental-test-coverage on a repo with test file names in the test directory beginning with a .. They will be INCLUDED in the coverage summary report while test files next to them without a leading . will not.
How often does it reproduce? Is there a required condition?
100%
What is the expected behavior? Why is that the expected behavior?
All files under test should be excluded by default - this is clearly the intent of the Node.js implementation.
What do you see instead?
"dotfiles" are included.
Additional information
This can presumably be fixed by setting the dot option to true in the call to minimatch here: https://github.com/nodejs/node/blob/v24.x/lib/internal/fs/glob.js#L784-L797
The observed (undesirable) behavior is documented by that project here: https://github.com/isaacs/minimatch#dot
The relevant default globs for Node are found here: https://github.com/nodejs/node/blob/v24.x/lib/internal/test_runner/utils.js#L62-L67
I have confirmed the following produces intended behavior on my machine: --test-coverage-exclude='test/**/{*,.*}'.
Version
24.15.0
Platform
Subsystem
No response
What steps will reproduce the bug?
Run
--experimental-test-coverageon a repo with test file names in thetestdirectory beginning with a.. They will be INCLUDED in the coverage summary report while test files next to them without a leading.will not.How often does it reproduce? Is there a required condition?
100%
What is the expected behavior? Why is that the expected behavior?
All files under
testshould be excluded by default - this is clearly the intent of the Node.js implementation.What do you see instead?
"dotfiles" are included.
Additional information
This can presumably be fixed by setting the
dotoption totruein the call tominimatchhere: https://github.com/nodejs/node/blob/v24.x/lib/internal/fs/glob.js#L784-L797The observed (undesirable) behavior is documented by that project here: https://github.com/isaacs/minimatch#dot
The relevant default globs for Node are found here: https://github.com/nodejs/node/blob/v24.x/lib/internal/test_runner/utils.js#L62-L67
I have confirmed the following produces intended behavior on my machine:
--test-coverage-exclude='test/**/{*,.*}'.