From 188f35711a0b09df8029a814a17b8bd584526180 Mon Sep 17 00:00:00 2001 From: Harshil Patel <26harshilpatel11@gmail.com> Date: Fri, 22 Nov 2024 22:03:30 -0500 Subject: [PATCH] test_runner: set level for coverage threshold diagnostics 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: https://github.com/nodejs/node/issues/55922 --- lib/internal/test_runner/test.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/internal/test_runner/test.js b/lib/internal/test_runner/test.js index abb8ed276dfacc..e678ad678ea736 100644 --- a/lib/internal/test_runner/test.js +++ b/lib/internal/test_runner/test.js @@ -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'); } }