Skip to content

Commit

Permalink
Tweak reporter integration tests so they pass on Node.js 12-pre
Browse files Browse the repository at this point in the history
  • Loading branch information
novemberborn committed Mar 27, 2019
1 parent a7605de commit 55d973d
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 6 deletions.
6 changes: 4 additions & 2 deletions test/fixture/report/regular/unhandled-rejection.js
@@ -1,9 +1,11 @@
import test from '../../../..';

test('passes', t => {
const passes = t => {
Promise.reject(new Error('Can\'t catch me'));
t.pass();
});
};

test('passes', passes);

test('unhandled non-error rejection', t => {
const err = null;
Expand Down
1 change: 1 addition & 0 deletions test/helper/report.js
Expand Up @@ -68,6 +68,7 @@ exports.sanitizers = {
lineEndings: str => replaceString(str, '\r\n', '\n'),
posix: str => replaceString(str, '\\', '/'),
slow: str => str.replace(/(slow.+?)\(\d+m?s\)/g, '$1 (000ms)'),
timeout: str => replaceString(str, 'Timeout._onTimeout', 'Timeout.setTimeout'),
// At least in Appveyor with Node.js 6, IPC can overtake stdout/stderr. This
// causes the reporter to emit in a different order, resulting in a test
// failure. "Fix" by not asserting on the stdout/stderr reporting at all.
Expand Down
2 changes: 1 addition & 1 deletion test/reporters/mini.regular.log
Expand Up @@ -445,7 +445,7 @@ stderr

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

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

Expand Down
2 changes: 1 addition & 1 deletion test/reporters/tap.js
Expand Up @@ -15,7 +15,7 @@ const run = (type, sanitizers = []) => t => {

const tty = new TTYStream({
columns: 200,
sanitizers: [...sanitizers, report.sanitizers.cwd, report.sanitizers.experimentalWarning, report.sanitizers.posix, report.sanitizers.unreliableProcessIO]
sanitizers: [...sanitizers, report.sanitizers.cwd, report.sanitizers.experimentalWarning, report.sanitizers.posix, report.sanitizers.timeout, report.sanitizers.unreliableProcessIO]
});
const reporter = new TapReporter({
reportStream: tty,
Expand Down
2 changes: 1 addition & 1 deletion test/reporters/tap.regular.log
Expand Up @@ -22,7 +22,7 @@ not ok 5 - Error: Can't catch me
---
name: Error
message: Can't catch me
at: 't (unhandled-rejection.js:4:17)'
at: 'passes (unhandled-rejection.js:4:17)'
...
---tty-stream-chunk-separator
# unhandled-rejection
Expand Down
2 changes: 1 addition & 1 deletion test/reporters/verbose.regular.log
Expand Up @@ -22,7 +22,7 @@

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

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

Expand Down

0 comments on commit 55d973d

Please sign in to comment.