Skip to content

test_runner: fix coverage ignore comments to exclude BRDA entries#62443

Open
wdskuki wants to merge 1 commit intonodejs:mainfrom
wdskuki:fix-coverage-ignore-brda
Open

test_runner: fix coverage ignore comments to exclude BRDA entries#62443
wdskuki wants to merge 1 commit intonodejs:mainfrom
wdskuki:fix-coverage-ignore-brda

Conversation

@wdskuki
Copy link

@wdskuki wdskuki commented Mar 26, 2026

When using /* node:coverage ignore next */ comments, the test_runner correctly excluded DA (line coverage) entries from lcov output, but still included BRDA (branch coverage) entries as uncovered. This caused branch coverage to report lower percentages than expected.

This fix ensures that branches completely covered by ignore comments are excluded from the branch coverage report, matching the behavior of c8 and user expectations.

Fixes: #61586

When using /* node:coverage ignore next */ comments, the test_runner
correctly excluded DA (line coverage) entries from lcov output, but
still included BRDA (branch coverage) entries as uncovered. This caused
branch coverage to report lower percentages than expected.

This fix ensures that branches completely covered by ignore comments
are excluded from the branch coverage report, matching the behavior
of c8 and user expectations.

Fixes: nodejs#61586
@nodejs-github-bot
Copy link
Collaborator

Review requested:

  • @nodejs/test_runner

@nodejs-github-bot nodejs-github-bot added needs-ci PRs that need a full CI run. test_runner Issues and PRs related to the test runner subsystem. labels Mar 26, 2026
@JakobJingleheimer JakobJingleheimer added the duplicate Issues and PRs that are duplicates of other issues or PRs. label Mar 26, 2026
@JakobJingleheimer
Copy link
Member

Duplicate of #61598

@JakobJingleheimer JakobJingleheimer marked this as a duplicate of #61598 Mar 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

duplicate Issues and PRs that are duplicates of other issues or PRs. needs-ci PRs that need a full CI run. test_runner Issues and PRs related to the test runner subsystem.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

test_runner: node:coverage ignore comments exclude DA but leave BRDA in lcov output

3 participants