Skip to content

Commit 91ed0f5

Browse files
committed
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 <contact@agentvote.cc>
1 parent a962e72 commit 91ed0f5

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

  • lib/internal/test_runner/reporter

lib/internal/test_runner/reporter/dot.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ module.exports = async function* dot(source) {
1010
let count = 0;
1111
let columns = getLineLength();
1212
const failedTests = [];
13+
const diagnostics = [];
1314
for await (const { type, data } of source) {
1415
if (type === 'test:pass') {
1516
yield `${colors.green}.${colors.reset}`;
@@ -18,6 +19,9 @@ module.exports = async function* dot(source) {
1819
yield `${colors.red}X${colors.reset}`;
1920
ArrayPrototypePush(failedTests, data);
2021
}
22+
if (type === 'test:diagnostic') {
23+
ArrayPrototypePush(diagnostics, data);
24+
}
2125
if ((type === 'test:fail' || type === 'test:pass') && ++count === columns) {
2226
yield '\n';
2327

@@ -33,6 +37,12 @@ module.exports = async function* dot(source) {
3337
yield formatTestReport('test:fail', test);
3438
}
3539
}
40+
if (diagnostics.length > 0) {
41+
yield `\n${colors.yellow}Diagnostics:${colors.white}\n\n`;
42+
for (const diag of diagnostics) {
43+
yield `${colors.yellow}! ${diag.message}${colors.reset}\n`;
44+
}
45+
}
3646
};
3747

3848
function getLineLength() {

0 commit comments

Comments
 (0)