Skip to content

Commit

Permalink
update test after execa update
Browse files Browse the repository at this point in the history
  • Loading branch information
SimenB committed Mar 28, 2020
1 parent 1fb0651 commit b68f138
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 15 deletions.
22 changes: 11 additions & 11 deletions e2e/__tests__/__snapshots__/wrongEnv.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@ exports[`Wrong globals for environment print useful error for document 1`] = `
ReferenceError: document is not defined
14 |
14 |
15 | test('use document', () => {
> 16 | const div = document.createElement('div');
| ^
17 |
17 |
18 | console.log(div);
19 |
19 |
at Object.document (__tests__/node.js:16:15)"
`;
Expand All @@ -34,11 +34,11 @@ exports[`Wrong globals for environment print useful error for unref 1`] = `
TypeError: setTimeout(...).unref is not a function
11 |
11 |
12 | test('use unref', () => {
> 13 | setTimeout(() => {}, 0).unref();
| ^
14 |
14 |
15 | expect(1).toBe(1);
16 | });
Expand All @@ -57,13 +57,13 @@ exports[`Wrong globals for environment print useful error for window 1`] = `
ReferenceError: window is not defined
22 |
22 |
23 | test('use window', () => {
> 24 | const location = window.location;
| ^
25 |
25 |
26 | console.log(location);
27 |
27 |
at Object.window (__tests__/node.js:24:20)"
`;
Expand All @@ -78,12 +78,12 @@ exports[`Wrong globals for environment print useful error when it explodes durin
ReferenceError: document is not defined
11 | /* eslint-env browser */
12 |
12 |
> 13 | const div = document.createElement('div');
| ^
14 |
14 |
15 | console.log(div);
16 |
16 |
at Object.document (__tests__/beforeTest.js:13:13)"
`;
8 changes: 4 additions & 4 deletions e2e/__tests__/wrongEnv.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,25 +11,25 @@ import {extractSummary} from '../Utils';
describe('Wrong globals for environment', () => {
it('print useful error for window', () => {
const result = runJest('wrong-env', ['node', '-t=window']);
expect(result.status).toBe(1);
expect(result.exitCode).toBe(1);
expect(extractSummary(result.stderr).rest).toMatchSnapshot();
});

it('print useful error for document', () => {
const result = runJest('wrong-env', ['node', '-t=document']);
expect(result.status).toBe(1);
expect(result.exitCode).toBe(1);
expect(extractSummary(result.stderr).rest).toMatchSnapshot();
});

it('print useful error for unref', () => {
const result = runJest('wrong-env', ['jsdom', '-t=unref']);
expect(result.status).toBe(1);
expect(result.exitCode).toBe(1);
expect(extractSummary(result.stderr).rest).toMatchSnapshot();
});

it('print useful error when it explodes during evaluation', () => {
const result = runJest('wrong-env', ['beforeTest']);
expect(result.status).toBe(1);
expect(result.exitCode).toBe(1);
expect(extractSummary(result.stderr).rest).toMatchSnapshot();
});
});

0 comments on commit b68f138

Please sign in to comment.