Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 449dad0

Browse filesBrowse files
avivkellertargos
authored andcommitted
test_runner: use test: symbol on second print of parent test
PR-URL: #54956 Reviewed-By: Moshe Atlow <moshe@atlow.co.il> Reviewed-By: James M Snell <jasnell@gmail.com>
1 parent 465d050 commit 449dad0
Copy full SHA for 449dad0

File tree

Expand file treeCollapse file tree

3 files changed

+6
-8
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

3 files changed

+6
-8
lines changed
Open diff view settings
Collapse file

‎lib/internal/test_runner/reporter/utils.js‎

Copy file name to clipboardExpand all lines: lib/internal/test_runner/reporter/utils.js
+4-6Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -72,16 +72,14 @@ function formatTestReport(type, data, prefix = '', indent = '', hasChildren = fa
7272
title += ` # ${typeof todo === 'string' && todo.length ? todo : 'TODO'}`;
7373
}
7474
const error = formatError(data.details?.error, indent);
75-
if (hasChildren) {
76-
// If this test has had children - it was already reported, so slightly modify the output
77-
const err = !error || data.details?.error?.failureType === 'subtestsFailed' ? '' : `\n${error}`;
78-
return `${prefix}${indent}${color}${reporterUnicodeSymbolMap['arrow:right']}${colors.white}${title}${err}`;
79-
}
75+
const err = hasChildren ?
76+
(!error || data.details?.error?.failureType === 'subtestsFailed' ? '' : `\n${error}`) :
77+
error;
8078
if (skip !== undefined) {
8179
color = colors.gray;
8280
symbol = reporterUnicodeSymbolMap['hyphen:minus'];
8381
}
84-
return `${prefix}${indent}${color}${symbol}${title}${colors.white}${error}`;
82+
return `${prefix}${indent}${color}${symbol}${title}${colors.white}${err}`;
8583
}
8684

8785
module.exports = {
Collapse file

‎test/fixtures/test-runner/output/default_output.snapshot‎

Copy file name to clipboardExpand all lines: test/fixtures/test-runner/output/default_output.snapshot
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
[31m✖ should pass but parent fail [90m(*ms)[39m[39m
2828
[32m'test did not finish before its parent and was cancelled'[39m
2929

30-
[31m▶ [39mparent [90m(*ms)[39m
30+
[31m✖ parent [90m(*ms)[39m[39m
3131
[34mℹ tests 6[39m
3232
[34mℹ suites 0[39m
3333
[34mℹ pass 1[39m
Collapse file

‎test/fixtures/test-runner/output/suite-skip-hooks.snapshot‎

Copy file name to clipboardExpand all lines: test/fixtures/test-runner/output/suite-skip-hooks.snapshot
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ AFTER 2
1212
✔ should run 1 (*ms)
1313
﹣ should not run (*ms) # SKIP
1414
✔ should run 2 (*ms)
15-
suite runs with mixture of skipped tests (*ms)
15+
suite runs with mixture of skipped tests (*ms)
1616
ℹ tests 4
1717
ℹ suites 2
1818
ℹ pass 2

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.