We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b345a17 commit 69c6071Copy full SHA for 69c6071
1 file changed
lib/internal/test_runner/coverage.js
@@ -263,14 +263,18 @@ class TestCoverage {
263
ObjectAssign(range, mapRangeToLines(range, lines));
264
265
if (isBlockCoverage) {
266
+ // If all lines in this range are ignored, report the branch as
267
+ // covered (count=1) instead of its actual V8 count. This matches
268
+ // the behavior of c8 and ensures the lcov output does not contain
269
+ // uncovered BRDA entries for ignored branches.
270
+ const count = range.ignoredLines === range.lines.length ? 1 : range.count;
271
ArrayPrototypePush(branchReports, {
272
__proto__: null,
273
line: range.lines[0]?.line,
- count: range.count,
274
+ count,
275
});
276
- if (range.count !== 0 ||
- range.ignoredLines === range.lines.length) {
277
+ if (count !== 0) {
278
branchesCovered++;
279
}
280
0 commit comments