Skip to content

Commit

Permalink
fix snapshot to be stable
Browse files Browse the repository at this point in the history
  • Loading branch information
SimenB committed Jul 17, 2019
1 parent 3f4183c commit 1f90d72
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 17 deletions.
23 changes: 8 additions & 15 deletions e2e/__tests__/__snapshots__/requireMissingExt.test.ts.snap
Expand Up @@ -13,22 +13,15 @@ FAIL ./test.js
See https://jestjs.io/docs/en/configuration#modulefileextensions-array-string
1 | 'use strict';
2 |
> 3 | require('discord.js');
| ^
4 |
5 | test('dummy', () => {
6 | expect(1).toBe(1);
8 | 'use strict';
9 |
> 10 | require('discord.js');
| ^
11 |
12 | test('dummy', () => {
13 | expect(1).toBe(1);
at Resolver.resolveModule (../../packages/jest-resolve/build/index.js:259:17)
at Object.<anonymous> (node_modules/discord.js/src/index.js:21:12)
at Object.require (test.js:3:1)
Test Suites: 1 failed, 1 total
Tests: 0 total
Snapshots: 0 total
Time: 0.847s
Ran all test suites.
at Object.require (test.js:10:1)
`;
5 changes: 3 additions & 2 deletions e2e/__tests__/requireMissingExt.test.ts
Expand Up @@ -7,7 +7,7 @@

import path from 'path';
import wrap from 'jest-snapshot-serializer-raw';
import {run} from '../Utils';
import {extractSummary, run} from '../Utils';
import runJest from '../runJest';

const dir = path.resolve(__dirname, '../require-missing-ext');
Expand All @@ -18,6 +18,7 @@ beforeEach(() => {

test('shows a proper error from deep requires', () => {
const {stderr} = runJest(dir);
const {rest} = extractSummary(stderr);

expect(wrap(stderr)).toMatchSnapshot();
expect(wrap(rest)).toMatchSnapshot();
});

0 comments on commit 1f90d72

Please sign in to comment.