From 91ed0f5b89637f3f2fc85394cc3cde9853aa4f94 Mon Sep 17 00:00:00 2001 From: armorbreak001 Date: Tue, 7 Jul 2026 02:40:45 +0800 Subject: [PATCH] test_runner: display diagnostic messages in dot reporter When using the dot reporter with coverage enabled, coverage failures would silently exit with an error code but show no output explaining the failure. This change collects and displays diagnostic messages (including coverage warnings) after the test dots, similar to how failed tests are displayed. Fixes: #60884 Signed-off-by: armorbreak001 --- lib/internal/test_runner/reporter/dot.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/lib/internal/test_runner/reporter/dot.js b/lib/internal/test_runner/reporter/dot.js index 45ff047bc4e5a0..fa29fdc73499fa 100644 --- a/lib/internal/test_runner/reporter/dot.js +++ b/lib/internal/test_runner/reporter/dot.js @@ -10,6 +10,7 @@ module.exports = async function* dot(source) { let count = 0; let columns = getLineLength(); const failedTests = []; + const diagnostics = []; for await (const { type, data } of source) { if (type === 'test:pass') { yield `${colors.green}.${colors.reset}`; @@ -18,6 +19,9 @@ module.exports = async function* dot(source) { yield `${colors.red}X${colors.reset}`; ArrayPrototypePush(failedTests, data); } + if (type === 'test:diagnostic') { + ArrayPrototypePush(diagnostics, data); + } if ((type === 'test:fail' || type === 'test:pass') && ++count === columns) { yield '\n'; @@ -33,6 +37,12 @@ module.exports = async function* dot(source) { yield formatTestReport('test:fail', test); } } + if (diagnostics.length > 0) { + yield `\n${colors.yellow}Diagnostics:${colors.white}\n\n`; + for (const diag of diagnostics) { + yield `${colors.yellow}! ${diag.message}${colors.reset}\n`; + } + } }; function getLineLength() {