Skip to content

Commit 9be6d80

Browse files
apply suggestion from @philnash
--- Co-authored-by: @philnash
1 parent 5caffef commit 9be6d80

1 file changed

Lines changed: 2 additions & 7 deletions

File tree

lib/internal/test_runner/coverage.js

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -198,18 +198,13 @@ class TestCoverage {
198198
continue;
199199
}
200200

201-
// If the branch is uncovered but contains ignored lines, treat it as
202-
// covered. This matches the behavior of tools like c8 and ensures that
203-
// ignored code doesn't penalize branch coverage.
204-
const branchCount = (range.count === 0 && range.ignoredLines > 0) ? 1 : range.count;
205-
206201
ArrayPrototypePush(branchReports, {
207202
__proto__: null,
208203
line: range.lines[0]?.line,
209-
count: branchCount,
204+
count: range.count,
210205
});
211206

212-
if (branchCount !== 0) {
207+
if (range.count !== 0) {
213208
branchesCovered++;
214209
}
215210

0 commit comments

Comments
 (0)