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 c0dd982

Browse filesBrowse files
MoLowaduh95
authored andcommitted
test_runner: differentiate todo and failure styles
PR-URL: #61564 Reviewed-By: Jacob Smith <jacob@frende.me> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Chemi Atlow <chemi@atlow.co.il>
1 parent 44b1927 commit c0dd982
Copy full SHA for c0dd982

2 files changed

+9-6Lines changed: 9 additions & 6 deletions

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
Expand file treeCollapse file tree
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
+7-4Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ const reporterUnicodeSymbolMap = {
2424
'test:coverage': '\u2139 ',
2525
'arrow:right': '\u25B6 ',
2626
'hyphen:minus': '\uFE63 ',
27+
'warning:alert': '\u26A0 ',
2728
};
2829

2930
const reporterColorMap = {
@@ -76,18 +77,20 @@ function formatTestReport(type, data, showErrorDetails = true, prefix = '', inde
7677

7778
if (skip !== undefined) {
7879
title += ` # ${typeof skip === 'string' && skip.length ? skip : 'SKIP'}`;
80+
color = colors.gray;
81+
symbol = reporterUnicodeSymbolMap['hyphen:minus'];
7982
} else if (todo !== undefined) {
8083
title += ` # ${typeof todo === 'string' && todo.length ? todo : 'TODO'}`;
84+
if (type === 'test:fail') {
85+
color = colors.yellow;
86+
symbol = reporterUnicodeSymbolMap['warning:alert'];
87+
}
8188
} else if (expectFailure !== undefined) {
8289
title += ` # EXPECTED FAILURE`;
8390
}
8491

8592
const err = showErrorDetails && data.details?.error ? formatError(data.details.error, indent) : '';
8693

87-
if (skip !== undefined) {
88-
color = colors.gray;
89-
symbol = reporterUnicodeSymbolMap['hyphen:minus'];
90-
}
9194
return `${prefix}${indent}${color}${symbol}${title}${colors.white}${err}`;
9295
}
9396

Collapse file

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

Copy file name to clipboardExpand all lines: test/fixtures/test-runner/output/dot_reporter.snapshot
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ X
66

77
Failed tests:
88

9-
sync fail todo (*ms) # TODO
9+
sync fail todo (*ms) # TODO
1010
Error: thrown from sync fail todo
1111
*
1212
*
@@ -15,7 +15,7 @@ Failed tests:
1515
*
1616
*
1717
*
18-
sync fail todo with message (*ms) # this is a failing todo
18+
sync fail todo with message (*ms) # this is a failing todo
1919
Error: thrown from sync fail todo with message
2020
*
2121
*

0 commit comments

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