Skip to content

Commit 13aedaa

Browse files
committed
doc: improve expectFailure example message
1 parent 5a15080 commit 13aedaa

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

doc/api/test.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@ it('should do the thing', { expectFailure: true }, () => {
246246
assert.strictEqual(doTheThing(), true);
247247
});
248248

249-
it('should do the thing', { expectFailure: 'flaky test' }, () => {
249+
it('should do the thing', { expectFailure: 'doTheThing is not doing the thing because ...' }, () => {
250250
assert.strictEqual(doTheThing(), true);
251251
});
252252
```

test/parallel/test-runner-xfail-message.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ const { spawn } = require('child_process');
55
const assert = require('node:assert');
66

77
if (process.env.CHILD_PROCESS === 'true') {
8-
test('fail with message', { expectFailure: 'flaky test reason' }, () => {
8+
test('fail with message', { expectFailure: 'doTheThing is not doing the thing because ...' }, () => {
99
assert.fail('boom');
1010
});
1111
} else {
@@ -20,6 +20,6 @@ if (process.env.CHILD_PROCESS === 'true') {
2020

2121
child.on('close', common.mustCall((code) => {
2222
assert.strictEqual(code, 0);
23-
assert.match(stdout, /# EXPECTED FAILURE flaky test reason/);
23+
assert.match(stdout, /# EXPECTED FAILURE doTheThing is not doing the thing because .../);
2424
}));
2525
}

0 commit comments

Comments
 (0)