Skip to content

Commit

Permalink
test_runner: set level for coverage threshold diagnostics
Browse files Browse the repository at this point in the history
Updated coverage threshold checks in  to use the
parameter when calling . Errors now use the
'error' level for red-colored formatting.

This ensures coverage errors are highlighted effectively in the output.

Fixes: nodejs#55922
  • Loading branch information
hpatel292-seneca committed Nov 23, 2024
1 parent 6b682ae commit 188f357
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/internal/test_runner/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -1086,7 +1086,7 @@ class Test extends AsyncResource {
if (actual < threshold) {
harness.success = false;
process.exitCode = kGenericUserError;
reporter.diagnostic(nesting, loc, `Error: ${NumberPrototypeToFixed(actual, 2)}% ${name} coverage does not meet threshold of ${threshold}%.`);
reporter.diagnostic(nesting, loc, `Error: ${NumberPrototypeToFixed(actual, 2)}% ${name} coverage does not meet threshold of ${threshold}%.`, 'error');
}
}

Expand Down

0 comments on commit 188f357

Please sign in to comment.