Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions lib/internal/test_runner/reporter/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ const reporterUnicodeSymbolMap = {
'test:coverage': '\u2139 ',
'arrow:right': '\u25B6 ',
'hyphen:minus': '\uFE63 ',
'warning:alert': '\u26A0 ',
};

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

if (skip !== undefined) {
title += ` # ${typeof skip === 'string' && skip.length ? skip : 'SKIP'}`;
color = colors.gray;
symbol = reporterUnicodeSymbolMap['hyphen:minus'];
} else if (todo !== undefined) {
title += ` # ${typeof todo === 'string' && todo.length ? todo : 'TODO'}`;
if (type === 'test:fail') {
color = colors.yellow;
symbol = reporterUnicodeSymbolMap['warning:alert'];
}
} else if (expectFailure !== undefined) {
title += ` # EXPECTED FAILURE`;
}

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

if (skip !== undefined) {
color = colors.gray;
symbol = reporterUnicodeSymbolMap['hyphen:minus'];
}
return `${prefix}${indent}${color}${symbol}${title}${colors.white}${err}`;
}

Expand Down
4 changes: 2 additions & 2 deletions test/fixtures/test-runner/output/dot_reporter.snapshot
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ X

Failed tests:

sync fail todo (*ms) # TODO
sync fail todo (*ms) # TODO
Error: thrown from sync fail todo
*
*
Expand All @@ -15,7 +15,7 @@ Failed tests:
*
*
*
sync fail todo with message (*ms) # this is a failing todo
sync fail todo with message (*ms) # this is a failing todo
Error: thrown from sync fail todo with message
*
*
Expand Down
Loading