Skip to content

Commit 6fe69d1

Browse files
authored
chore: avoid adding trailing whitespace to blank lines in stack traces (#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
1 parent 95c1e53 commit 6fe69d1

12 files changed

Lines changed: 159 additions & 190 deletions

File tree

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,8 @@
191191
([#5812](https://github.com/facebook/jest/issues/5812))
192192
* `[jest-runtime]` [**BREAKING**] Remove `jest.genMockFn` and
193193
`jest.genMockFunction` ([#6173](https://github.com/facebook/jest/pull/6173))
194+
* `[jest-message-util]` Avoid adding unnecessary indent to blank lines in stack
195+
traces ([#6211](https://github.com/facebook/jest/pull/6211))
194196

195197
## 22.4.2
196198

integration-tests/__tests__/__snapshots__/custom_matcher_stack_trace.test.js.snap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ exports[`works with custom matchers 1`] = `
1818
46 | };
1919
47 |
2020
48 | // This expecation fails due to an error we throw (intentionally)
21-
21+
2222
at __tests__/custom_matcher.test.js:45:13
2323
at __tests__/custom_matcher.test.js:43:23
2424
at __tests__/custom_matcher.test.js:42:23

integration-tests/__tests__/__snapshots__/detect_open_handles.js.snap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ exports[`prints out info about open handlers 1`] = `
2222
> 7 | app.listen({host: 'localhost', port: 0});
2323
| ^
2424
8 |
25-
25+
2626
at Object.<anonymous> (server.js:7:5)
2727
at Object.<anonymous> (__tests__/test.js:3:1)"
2828
`;

integration-tests/__tests__/__snapshots__/each.test.js.snap

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,16 @@ exports[`shows error message when not enough arguments are supplied to tests 1`]
88
99
Not enough arguments supplied for given headings:
1010
left | right
11-
11+
1212
Received:
1313
Array [
1414
true,
1515
true,
1616
true,
1717
]
18-
18+
1919
Missing 1 arguments
20-
20+
2121
at packages/jest-jasmine2/build/each.js:84:17
2222
2323
"

integration-tests/__tests__/__snapshots__/expect-async-matcher.test.js.snap

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ exports[`shows the correct errors in stderr when failing tests 1`] = `
1010
● fail with expected non promise values
1111
1212
Error
13+
1314
Error: Expected value to have length:
1415
2
1516
Received:
@@ -20,6 +21,7 @@ exports[`shows the correct errors in stderr when failing tests 1`] = `
2021
● fail with expected non promise values and not
2122
2223
Error
24+
2325
Error: Expected value to not have length:
2426
2
2527
Received:
@@ -43,7 +45,7 @@ exports[`shows the correct errors in stderr when failing tests 1`] = `
4345
25 | Promise.resolve(2)
4446
26 | );
4547
27 | });
46-
48+
4749
at __tests__/failure.test.js:24:54
4850
at __tests__/failure.test.js:11:191
4951
at __tests__/failure.test.js:11:437
@@ -65,7 +67,7 @@ exports[`shows the correct errors in stderr when failing tests 1`] = `
6567
31 | Promise.resolve(2)
6668
32 | );
6769
33 | });
68-
70+
6971
at __tests__/failure.test.js:30:61
7072
at __tests__/failure.test.js:11:191
7173
at __tests__/failure.test.js:11:437

0 commit comments

Comments
 (0)