test_runner: use test: symbol on second print of parent test

PR-URL: https://github.com/nodejs/node/pull/54956
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
Reviewed-By: James M Snell <jasnell@gmail.com>
This commit is contained in:
RedYetiDev authored and Michaël Zasso committed 2024-10-04 10:20:17 +02:00
1 parent 465d05018a
commit 449dad0db0
3 files changed
+6 -8

No files matched your search

+4 -6
View File
@@ -72,16 +72,14 @@ function formatTestReport(type, data, prefix = '', indent = '', hasChildren = fa
title += ` # ${typeof todo === 'string' && todo.length ? todo : 'TODO'}`;
}
const error = formatError(data.details?.error, indent);
if (hasChildren) {
// If this test has had children - it was already reported, so slightly modify the output
const err = !error || data.details?.error?.failureType === 'subtestsFailed' ? '' : `\n${error}`;
return `${prefix}${indent}${color}${reporterUnicodeSymbolMap['arrow:right']}${colors.white}${title}${err}`;
}
const err = hasChildren ?
(!error || data.details?.error?.failureType === 'subtestsFailed' ? '' : `\n${error}`) :
error;
if (skip !== undefined) {
color = colors.gray;
symbol = reporterUnicodeSymbolMap['hyphen:minus'];
}
return `${prefix}${indent}${color}${symbol}${title}${colors.white}${error}`;
return `${prefix}${indent}${color}${symbol}${title}${colors.white}${err}`;
}
module.exports = {
+1 -1
View File
@@ -27,7 +27,7 @@
[31m✖ should pass but parent fail [90m(*ms)[39m[39m
[32m'test did not finish before its parent and was cancelled'[39m
[31m▶ [39mparent [90m(*ms)[39m
[31m✖ parent [90m(*ms)[39m[39m
[34mℹ tests 6[39m
[34mℹ suites 0[39m
[34mℹ pass 1[39m
+1 -1
View File
@@ -12,7 +12,7 @@ AFTER 2
✔ should run 1 (*ms)
﹣ should not run (*ms) # SKIP
✔ should run 2 (*ms)
▶ suite runs with mixture of skipped tests (*ms)
✔ suite runs with mixture of skipped tests (*ms)
ℹ tests 4
ℹ suites 2
ℹ pass 2