Skip to content

Commit

Permalink
Remove unnessecary snapshot normalisation
Browse files Browse the repository at this point in the history
  • Loading branch information
mattphillips committed Sep 19, 2018
1 parent 54fac6d commit 8891c36
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 28 deletions.
16 changes: 8 additions & 8 deletions e2e/__tests__/__snapshots__/test-todo.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ exports[`shows error messages when called with invalid argument 1`] = `
Todo must be called with only a description.
6 | */
7 |
7 |
> 8 | it.todo(() => {});
| ^
9 |
9 |
at __tests__/todo_non_string.test.js:8:4
Expand All @@ -24,10 +24,10 @@ exports[`shows error messages when called with multiple arguments 1`] = `
Todo must be called with only a description.
6 | */
7 |
7 |
> 8 | it.todo('todo later', () => {});
| ^
9 |
9 |
at __tests__/todo_multiple_args.test.js:8:4
Expand All @@ -41,10 +41,10 @@ exports[`shows error messages when called with no arguments 1`] = `
Todo must be called with only a description.
6 | */
7 |
7 |
> 8 | it.todo();
| ^
9 |
9 |
at __tests__/todo_no_args.test.js:8:4
Expand All @@ -65,12 +65,12 @@ exports[`works with all statuses 1`] = `
Expected: 101
Received: 10
11 |
11 |
12 | it('fails', () => {
> 13 | expect(10).toBe(101);
| ^
14 | });
15 |
15 |
16 | it.skip('skips', () => {
at __tests__/statuses.test.js:13:14
Expand Down
28 changes: 8 additions & 20 deletions e2e/__tests__/test-todo.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,39 +17,27 @@ const dir = path.resolve(__dirname, '../test-todo');
test('works with all statuses', () => {
const result = runJest(dir, ['statuses.test.js']);
expect(result.status).toBe(1);
const output = extractSummary(result.stderr)
.rest.split('\n')
.map(line => line.trimRight())
.join('\n');
expect(output).toMatchSnapshot();
const {rest} = extractSummary(result.stderr);
expect(rest).toMatchSnapshot();
});

test('shows error messages when called with no arguments', () => {
const result = runJest(dir, ['todo_no_args.test.js']);
expect(result.status).toBe(1);
const output = extractSummary(result.stderr)
.rest.split('\n')
.map(line => line.trimRight())
.join('\n');
expect(output).toMatchSnapshot();
const {rest} = extractSummary(result.stderr);
expect(rest).toMatchSnapshot();
});

test('shows error messages when called with multiple arguments', () => {
const result = runJest(dir, ['todo_multiple_args.test.js']);
expect(result.status).toBe(1);
const output = extractSummary(result.stderr)
.rest.split('\n')
.map(line => line.trimRight())
.join('\n');
expect(output).toMatchSnapshot();
const {rest} = extractSummary(result.stderr);
expect(rest).toMatchSnapshot();
});

test('shows error messages when called with invalid argument', () => {
const result = runJest(dir, ['todo_non_string.test.js']);
expect(result.status).toBe(1);
const output = extractSummary(result.stderr)
.rest.split('\n')
.map(line => line.trimRight())
.join('\n');
expect(output).toMatchSnapshot();
const {rest} = extractSummary(result.stderr);
expect(rest).toMatchSnapshot();
});

0 comments on commit 8891c36

Please sign in to comment.