From 6d5ed1de68c9bacc32dba805a063051fa2acaec1 Mon Sep 17 00:00:00 2001 From: RedYetiDev <38299977+RedYetiDev@users.noreply.github.com> Date: Sun, 15 Sep 2024 15:52:28 -0400 Subject: [PATCH] test_runner: use `test:` symbol on second print of parent test --- lib/internal/test_runner/reporter/utils.js | 10 ++++------ .../test-runner/output/default_output.snapshot | 2 +- .../test-runner/output/suite-skip-hooks.snapshot | 2 +- 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/lib/internal/test_runner/reporter/utils.js b/lib/internal/test_runner/reporter/utils.js index 42c4ffa3cdaaec..9b6cc96a185a9a 100644 --- a/lib/internal/test_runner/reporter/utils.js +++ b/lib/internal/test_runner/reporter/utils.js @@ -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 = { diff --git a/test/fixtures/test-runner/output/default_output.snapshot b/test/fixtures/test-runner/output/default_output.snapshot index 96450b05bc7ec8..73bfc1da5e92e9 100644 --- a/test/fixtures/test-runner/output/default_output.snapshot +++ b/test/fixtures/test-runner/output/default_output.snapshot @@ -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 diff --git a/test/fixtures/test-runner/output/suite-skip-hooks.snapshot b/test/fixtures/test-runner/output/suite-skip-hooks.snapshot index b7fc826426eaf9..91949ea6217b66 100644 --- a/test/fixtures/test-runner/output/suite-skip-hooks.snapshot +++ b/test/fixtures/test-runner/output/suite-skip-hooks.snapshot @@ -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