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
When using /* node:coverage ignore next */ comments, the DA (line coverage) entries are correctly excluded from the LCOV output, but BRDA (branch coverage) entries for branches leading to ignored lines remain as uncovered. This causes false branch coverage failures.
Problem
DA entries are excluded
BRDA entries are NOT excluded
Results in incorrect branch coverage percentages (e.g., 66.67% instead of 100%)
Breaks CI/CD pipelines with branch coverage thresholds
Solution
Modified lib/internal/test_runner/coverage.js to exclude branches that are entirely on ignored lines from the branch coverage totals, matching the behavior of line coverage exclusion.
Changes
Only include branches in branchReports if they are not entirely on ignored lines
Ensures consistency with c8 and other coverage tools
Please add/adjust tests (might want for ci completion to see if there are any failures, or just run python3 tools/test.py "test/test-runner/*" and python3 tools/test.py "test/parallel/test-runner-*)
✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 89.72%. Comparing base (3fc542e) to head (48310bc). ⚠️ Report is 1580 commits behind head on main.
This pull request has been marked as stale due to 90 days of inactivity.
It will be automatically closed in 30 days if no further activity occurs. If this is still relevant, please leave a comment or update it to keep it open.
github-actionsBot
added
the
stale
Issues and PRs marked stale due to inactivity and scheduled for automatic closure.
label
Jul 28, 2026
This pull request has been automatically closed after 30 days of inactivity following its stale status (no activity for a total of 120 days).
If this is still relevant, feel free to reopen it or leave a comment with additional details so we can continue the discussion.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
duplicateIssues and PRs that are duplicates of other issues or PRs.needs-ciPRs that need a full CI run.staleIssues and PRs marked stale due to inactivity and scheduled for automatic closure.test_runnerIssues and PRs related to the test runner subsystem.
4 participants
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue
When using
/* node:coverage ignore next */comments, the DA (line coverage) entries are correctly excluded from the LCOV output, but BRDA (branch coverage) entries for branches leading to ignored lines remain as uncovered. This causes false branch coverage failures.Problem
Solution
Modified
lib/internal/test_runner/coverage.jsto exclude branches that are entirely on ignored lines from the branch coverage totals, matching the behavior of line coverage exclusion.Changes
branchReportsif they are not entirely on ignored linesTesting
The fix can be verified with the minimal reproduction case from the issue:
https://github.com/tobigumo/node-coverage-brda-bug