Skip to content

Commit

Permalink
chore: avoid adding trailing whitespace to blank lines in stack traces (
Browse files Browse the repository at this point in the history
#6211)

* chore: avoid adding trailing whitespace to blank lines

* link to PR

* trim for node 9 and 10 as well

* remove unecessary double stack when we have one

* trim moar

* trim when adding custom stack trace

* update other snapshots
  • Loading branch information
SimenB committed May 22, 2018
1 parent 95c1e53 commit 6fe69d1
Show file tree
Hide file tree
Showing 12 changed files with 159 additions and 190 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,8 @@
([#5812](https://github.com/facebook/jest/issues/5812))
* `[jest-runtime]` [**BREAKING**] Remove `jest.genMockFn` and
`jest.genMockFunction` ([#6173](https://github.com/facebook/jest/pull/6173))
* `[jest-message-util]` Avoid adding unnecessary indent to blank lines in stack
traces ([#6211](https://github.com/facebook/jest/pull/6211))

## 22.4.2

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ exports[`works with custom matchers 1`] = `
46 | };
47 |
48 | // This expecation fails due to an error we throw (intentionally)
at __tests__/custom_matcher.test.js:45:13
at __tests__/custom_matcher.test.js:43:23
at __tests__/custom_matcher.test.js:42:23
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ exports[`prints out info about open handlers 1`] = `
> 7 | app.listen({host: 'localhost', port: 0});
| ^
8 |
at Object.<anonymous> (server.js:7:5)
at Object.<anonymous> (__tests__/test.js:3:1)"
`;
6 changes: 3 additions & 3 deletions integration-tests/__tests__/__snapshots__/each.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,16 @@ exports[`shows error message when not enough arguments are supplied to tests 1`]
Not enough arguments supplied for given headings:
left | right
Received:
Array [
true,
true,
true,
]
Missing 1 arguments
at packages/jest-jasmine2/build/each.js:84:17
"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ exports[`shows the correct errors in stderr when failing tests 1`] = `
● fail with expected non promise values
Error
Error: Expected value to have length:
2
Received:
Expand All @@ -20,6 +21,7 @@ exports[`shows the correct errors in stderr when failing tests 1`] = `
● fail with expected non promise values and not
Error
Error: Expected value to not have length:
2
Received:
Expand All @@ -43,7 +45,7 @@ exports[`shows the correct errors in stderr when failing tests 1`] = `
25 | Promise.resolve(2)
26 | );
27 | });
at __tests__/failure.test.js:24:54
at __tests__/failure.test.js:11:191
at __tests__/failure.test.js:11:437
Expand All @@ -65,7 +67,7 @@ exports[`shows the correct errors in stderr when failing tests 1`] = `
31 | Promise.resolve(2)
32 | );
33 | });
at __tests__/failure.test.js:30:61
at __tests__/failure.test.js:11:191
at __tests__/failure.test.js:11:437
Expand Down
Loading

0 comments on commit 6fe69d1

Please sign in to comment.