Skip to content

Commit 55d973d

Browse files
committed
Tweak reporter integration tests so they pass on Node.js 12-pre
1 parent a7605de commit 55d973d

File tree

6 files changed

+9
-6
lines changed

6 files changed

+9
-6
lines changed

test/fixture/report/regular/unhandled-rejection.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
import test from '../../../..';
22

3-
test('passes', t => {
3+
const passes = t => {
44
Promise.reject(new Error('Can\'t catch me'));
55
t.pass();
6-
});
6+
};
7+
8+
test('passes', passes);
79

810
test('unhandled non-error rejection', t => {
911
const err = null;

test/helper/report.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ exports.sanitizers = {
6868
lineEndings: str => replaceString(str, '\r\n', '\n'),
6969
posix: str => replaceString(str, '\\', '/'),
7070
slow: str => str.replace(/(slow.+?)\(\d+m?s\)/g, '$1 (000ms)'),
71+
timeout: str => replaceString(str, 'Timeout._onTimeout', 'Timeout.setTimeout'),
7172
// At least in Appveyor with Node.js 6, IPC can overtake stdout/stderr. This
7273
// causes the reporter to emit in a different order, resulting in a test
7374
// failure. "Fix" by not asserting on the stdout/stderr reporting at all.

test/reporters/mini.regular.log

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -445,7 +445,7 @@ stderr
445445

446446
~/test/fixture/report/regular/unhandled-rejection.js:4
447447

448-
3: test('passes', t => {
448+
3: const passes = t => {
449449
 4: Promise.reject(new Error('Can/'t catch me'));
450450
5: t.pass();
451451

test/reporters/tap.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ const run = (type, sanitizers = []) => t => {
1515

1616
const tty = new TTYStream({
1717
columns: 200,
18-
sanitizers: [...sanitizers, report.sanitizers.cwd, report.sanitizers.experimentalWarning, report.sanitizers.posix, report.sanitizers.unreliableProcessIO]
18+
sanitizers: [...sanitizers, report.sanitizers.cwd, report.sanitizers.experimentalWarning, report.sanitizers.posix, report.sanitizers.timeout, report.sanitizers.unreliableProcessIO]
1919
});
2020
const reporter = new TapReporter({
2121
reportStream: tty,

test/reporters/tap.regular.log

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ not ok 5 - Error: Can't catch me
2222
---
2323
name: Error
2424
message: Can't catch me
25-
at: 't (unhandled-rejection.js:4:17)'
25+
at: 'passes (unhandled-rejection.js:4:17)'
2626
...
2727
---tty-stream-chunk-separator
2828
# unhandled-rejection

test/reporters/verbose.regular.log

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222

2323
~/test/fixture/report/regular/unhandled-rejection.js:4
2424

25-
3: test('passes', t => {
25+
3: const passes = t => {
2626
 4: Promise.reject(new Error('Can/'t catch me'));
2727
5: t.pass();
2828

0 commit comments

Comments
 (0)