Skip to content

test_runner: display coverage errors in dot reporter#64695

Open
elephant-y wants to merge 1 commit into
nodejs:mainfrom
elephant-y:fix/dot-reporter-coverage-errors
Open

test_runner: display coverage errors in dot reporter#64695
elephant-y wants to merge 1 commit into
nodejs:mainfrom
elephant-y:fix/dot-reporter-coverage-errors

Conversation

@elephant-y

Copy link
Copy Markdown

When using the dot reporter with --experimental-test-coverage and
coverage thresholds, if a threshold is not met, the dot reporter
outputs only dots (.) with no error message. The process exits with
code 1 but gives no indication of what went wrong.

This happens because the dot reporter does not handle
test:diagnostic events with error level, which are emitted when
coverage thresholds are not satisfied.

Changes

  • Added handling for test:diagnostic events with level === 'error'
  • Collected error messages are displayed after the dot output,
    similar to how failed tests are displayed

Before

$ node --test --experimental-test-coverage --test-reporter=dot \
  --test-coverage-lines=100 test.js
.

$ echo $?
1           # failed but no error shown

After

$ node --test --experimental-test-coverage --test-reporter=dot \
  --test-coverage-lines=100 test.js
.

Diagnostic errors:

Error: 85.00% line coverage does not meet threshold of 100.00%.
$ echo $?
1

Fixes: #60884

@nodejs-github-bot

Copy link
Copy Markdown
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 Jul 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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: print failed coverage reports with dot runner

2 participants