Skip to content

Commit

Permalink
chore: fix test for node 6
Browse files Browse the repository at this point in the history
  • Loading branch information
SimenB committed Feb 13, 2019
1 parent 00bd060 commit e136b8d
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 13 deletions.
16 changes: 8 additions & 8 deletions e2e/__tests__/__snapshots__/customMatcherStackTrace.test.js.snap
Expand Up @@ -9,14 +9,14 @@ FAIL __tests__/asynchronous.test.js
We expect the stack trace and code fence for this matcher to be shown in the console.
9 |
10 | test('showing the stack trace for an async matcher', async () => {
> 11 | await expect(true).toThrowCustomAsyncMatcherError();
| ^
12 | });
13 |
14 | async function toThrowCustomAsyncMatcherError() {
at Object.toThrowCustomAsyncMatcherError (__tests__/asynchronous.test.js:11:22)
10 | test('showing the stack trace for an async matcher', () =>
> 11 | expect(true).toThrowCustomAsyncMatcherError());
| ^
12 |
13 | function toThrowCustomAsyncMatcherError() {
14 | const message = () =>
at Object.toThrowCustomAsyncMatcherError (__tests__/asynchronous.test.js:11:16)
`;
exports[`works with custom matchers 1`] = `
Expand Down
9 changes: 4 additions & 5 deletions e2e/custom-matcher-stack-trace/__tests__/asynchronous.test.js
Expand Up @@ -7,12 +7,11 @@

expect.extend({toThrowCustomAsyncMatcherError});

test('showing the stack trace for an async matcher', async () => {
await expect(true).toThrowCustomAsyncMatcherError();
});
test('showing the stack trace for an async matcher', () =>
expect(true).toThrowCustomAsyncMatcherError());

async function toThrowCustomAsyncMatcherError() {
function toThrowCustomAsyncMatcherError() {
const message = () =>
'We expect the stack trace and code fence for this matcher to be shown in the console.';
return {message, pass: false};
return Promise.resolve({message, pass: false});
}

0 comments on commit e136b8d

Please sign in to comment.