Skip to content

Commit c0dd982

Browse 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

2 files changed

Lines changed: 9 additions & 6 deletions

File tree

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

Lines 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
constreporterColorMap={
@@ -76,18 +77,20 @@ function formatTestReport(type, data, showErrorDetails = true, prefix = '', inde
7677

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

8592
consterr=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

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

Lines 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)