Skip to content

Commit 9c9691c

Browse files
fixup!: add # EXPECTED FAILURE to other builtin reporter output
1 parent 4d29892 commit 9c9691c

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

lib/internal/test_runner/reporter/tap.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ function reportTest(nesting, testNumber, status, name, skip, todo, xfail) {
8080
// `skip` should trump, and `todo` + `fail` is a mistake, but it will already fail, so nothing to
8181
// do when this is after `todo`.
8282
else if (xfail !== undefined) {
83-
line += ' # EXPECTED FAIL';
83+
line += ' # EXPECTED FAILURE';
8484
}
8585

8686
line += '\n';

lib/internal/test_runner/reporter/utils.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,14 +71,16 @@ function formatError(error, indent) {
7171
function formatTestReport(type, data, prefix = '', indent = '', hasChildren = false, showErrorDetails = true) {
7272
let color = reporterColorMap[type] ?? colors.white;
7373
let symbol = reporterUnicodeSymbolMap[type] ?? ' ';
74-
const { skip, todo } = data;
74+
const { skip, todo, xfail } = data;
7575
const duration_ms = data.details?.duration_ms ? ` ${colors.gray}(${data.details.duration_ms}ms)${colors.white}` : '';
7676
let title = `${data.name}${duration_ms}`;
7777

7878
if (skip !== undefined) {
7979
title += ` # ${typeof skip === 'string' && skip.length ? skip : 'SKIP'}`;
8080
} else if (todo !== undefined) {
8181
title += ` # ${typeof todo === 'string' && todo.length ? todo : 'TODO'}`;
82+
} else if (xfail !== undefined) {
83+
title += ` # EXPECTED FAILURE`;
8284
}
8385

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

0 commit comments

Comments
 (0)