Skip to content

Commit b0e1f2c

Browse files
committed
fixup! test_runner: match dotfiles in default coverage exclude
Signed-off-by: semimikoh <ejffjeosms@gmail.com>
1 parent c72d1eb commit b0e1f2c

2 files changed

Lines changed: 5 additions & 3 deletions

File tree

lib/internal/test_runner/coverage.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -483,11 +483,14 @@ class TestCoverage {
483483
} = this.options;
484484

485485
// This check filters out files that match the exclude globs.
486+
// dot:true is only applied to relativePath so user-supplied globs match
487+
// dotfiles within the project, without misinterpreting dot segments in the
488+
// absolute filesystem path (e.g. test tmp dirs like `test/.tmp.0`).
486489
if (excludeGlobs?.length > 0) {
487490
for (let i = 0; i < excludeGlobs.length; ++i) {
488491
if (
489492
matchCoverageGlob(relativePath, excludeGlobs[i]) ||
490-
matchCoverageGlob(absolutePath, excludeGlobs[i])
493+
matchGlobPattern(absolutePath, excludeGlobs[i])
491494
) return true;
492495
}
493496
}
@@ -497,7 +500,7 @@ class TestCoverage {
497500
for (let i = 0; i < includeGlobs.length; ++i) {
498501
if (
499502
matchCoverageGlob(relativePath, includeGlobs[i]) ||
500-
matchCoverageGlob(absolutePath, includeGlobs[i])
503+
matchGlobPattern(absolutePath, includeGlobs[i])
501504
) return false;
502505
}
503506
return true;

test/parallel/test-runner-coverage-default-exclusion.mjs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ async function setupFixtures() {
1818

1919
function assertDefaultExclusions(stdout) {
2020
assert.match(stdout, /# start of coverage report/);
21-
assert.match(stdout, /# logic-file\.js\s+\|/);
2221
assert.doesNotMatch(stdout, /# file-test\.js\s+\|/);
2322
assert.doesNotMatch(stdout, /# file\.test\.mjs\s+\|/);
2423
assert.doesNotMatch(stdout, /# file\.test\.ts\s+\|/);

0 commit comments

Comments
 (0)