Skip to content

Commit f150c79

Browse files
committed
trim moar
1 parent 09251f2 commit f150c79

3 files changed

Lines changed: 44 additions & 44 deletions

File tree

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

Lines changed: 39 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ exports[`not throwing Error objects 4`] = `
5050
14 | };
5151
15 | const redeclare = () => {
5252
16 | expect.assertions(1);
53-
53+
5454
at __tests__/assertion_count.test.js:13:17
5555
5656
● .assertions() › throws
@@ -66,7 +66,7 @@ exports[`not throwing Error objects 4`] = `
6666
13 | expect(false).toBeTruthy();
6767
14 | };
6868
15 | const redeclare = () => {
69-
69+
7070
at __tests__/assertion_count.test.js:12:10
7171
7272
● .assertions() › throws on redeclare of assertion count
@@ -82,7 +82,7 @@ exports[`not throwing Error objects 4`] = `
8282
18 | expect.assertions(2);
8383
19 | };
8484
20 |
85-
85+
8686
at __tests__/assertion_count.test.js:17:17
8787
8888
● .assertions() › throws on assertion
@@ -98,7 +98,7 @@ exports[`not throwing Error objects 4`] = `
9898
23 | expect(true).toBeTruthy();
9999
24 | };
100100
25 |
101-
101+
102102
at __tests__/assertion_count.test.js:22:10
103103
104104
● .hasAssertions() › throws when there are not assertions
@@ -114,7 +114,7 @@ exports[`not throwing Error objects 4`] = `
114114
28 | };
115115
29 |
116116
30 | describe('.assertions()', () => {
117-
117+
118118
at __tests__/assertion_count.test.js:27:10
119119
120120
"
@@ -141,8 +141,8 @@ exports[`not throwing Error objects 5`] = `
141141
8 | throw Promise.resolve(5);
142142
9 | });
143143
10 |
144-
145-
144+
145+
146146
at packages/jest-jasmine2/build/jasmine/Spec.js:85:20
147147
at __tests__/during_tests.test.js:7:1
148148
@@ -157,8 +157,8 @@ exports[`not throwing Error objects 5`] = `
157157
12 | // eslint-disable-next-line no-throw-literal
158158
13 | throw false;
159159
14 | });
160-
161-
160+
161+
162162
at packages/jest-jasmine2/build/jasmine/Spec.js:85:20
163163
at __tests__/during_tests.test.js:11:1
164164
@@ -173,8 +173,8 @@ exports[`not throwing Error objects 5`] = `
173173
17 | // eslint-disable-next-line no-throw-literal
174174
18 | throw undefined;
175175
19 | });
176-
177-
176+
177+
178178
at packages/jest-jasmine2/build/jasmine/Spec.js:85:20
179179
at __tests__/during_tests.test.js:16:1
180180
@@ -196,8 +196,8 @@ exports[`not throwing Error objects 5`] = `
196196
22 | // eslint-disable-next-line no-throw-literal
197197
23 | throw deepObject;
198198
24 | });
199-
200-
199+
200+
201201
at packages/jest-jasmine2/build/jasmine/Spec.js:85:20
202202
at __tests__/during_tests.test.js:21:1
203203
@@ -212,7 +212,7 @@ exports[`not throwing Error objects 5`] = `
212212
29 | });
213213
30 |
214214
31 | test('done(Error)', done => {
215-
215+
216216
at __tests__/during_tests.test.js:28:3
217217
218218
done(Error)
@@ -226,7 +226,7 @@ exports[`not throwing Error objects 5`] = `
226226
33 | });
227227
34 |
228228
35 | test('done(non-error)', done => {
229-
229+
230230
at __tests__/during_tests.test.js:32:8
231231
232232
done(non-error)
@@ -246,7 +246,7 @@ exports[`not throwing Error objects 5`] = `
246246
| ^
247247
37 | });
248248
38 |
249-
249+
250250
at packages/jest-jasmine2/build/jasmine/Env.js:541:34
251251
at __tests__/during_tests.test.js:36:3
252252
@@ -272,7 +272,7 @@ exports[`works with assertions in separate files 1`] = `
272272
| ^
273273
13 | };
274274
14 |
275-
275+
276276
at macros.js:12:15
277277
at __tests__/test_macro.test.js:14:3
278278
@@ -313,7 +313,7 @@ exports[`works with async failures 1`] = `
313313
13 | });
314314
14 |
315315
15 | test('reject, but fail', () => {
316-
316+
317317
at __tests__/async_failures.test.js:12:57
318318
319319
reject, but fail
@@ -342,7 +342,7 @@ exports[`works with async failures 1`] = `
342342
17 | });
343343
18 |
344344
19 | test('expect reject', () => {
345-
345+
346346
at __tests__/async_failures.test.js:16:55
347347
348348
expect reject
@@ -359,7 +359,7 @@ exports[`works with async failures 1`] = `
359359
21 | });
360360
22 |
361361
23 | test('expect resolve', () => {
362-
362+
363363
at __tests__/async_failures.test.js:20:10
364364
365365
expect resolve
@@ -376,7 +376,7 @@ exports[`works with async failures 1`] = `
376376
25 | });
377377
26 |
378378
27 | test('timeout', done => {
379-
379+
380380
at __tests__/async_failures.test.js:24:10
381381
382382
timeout
@@ -390,7 +390,7 @@ exports[`works with async failures 1`] = `
390390
28 | jest.setTimeout(5);
391391
29 |
392392
30 | setTimeout(done, 10);
393-
393+
394394
at packages/jest-jasmine2/build/jasmine/Spec.js:85:20
395395
at __tests__/async_failures.test.js:27:1
396396
@@ -419,7 +419,7 @@ exports[`works with named snapshot failures 1`] = `
419419
| ^
420420
13 | });
421421
14 |
422-
422+
423423
at __tests__/snapshot_named.test.js:12:17
424424
425425
› 1 snapshot failed.
@@ -461,7 +461,7 @@ exports[`works with node assert 1`] = `
461461
16 | });
462462
17 |
463463
18 | test('assert with a message', () => {
464-
464+
465465
at __tests__/node_assertion_error.test.js:15:3
466466
467467
assert with a message
@@ -483,7 +483,7 @@ exports[`works with node assert 1`] = `
483483
20 | });
484484
21 |
485485
22 | test('assert.ok', () => {
486-
486+
487487
at __tests__/node_assertion_error.test.js:19:3
488488
489489
assert.ok
@@ -502,7 +502,7 @@ exports[`works with node assert 1`] = `
502502
24 | });
503503
25 |
504504
26 | test('assert.ok with a message', () => {
505-
505+
506506
at __tests__/node_assertion_error.test.js:23:10
507507
508508
assert.ok with a message
@@ -524,7 +524,7 @@ exports[`works with node assert 1`] = `
524524
28 | });
525525
29 |
526526
30 | test('assert.equal', () => {
527-
527+
528528
at __tests__/node_assertion_error.test.js:27:10
529529
530530
assert.equal
@@ -543,7 +543,7 @@ exports[`works with node assert 1`] = `
543543
32 | });
544544
33 |
545545
34 | test('assert.notEqual', () => {
546-
546+
547547
at __tests__/node_assertion_error.test.js:31:10
548548
549549
assert.notEqual
@@ -566,7 +566,7 @@ exports[`works with node assert 1`] = `
566566
36 | });
567567
37 |
568568
38 | test('assert.deepEqual', () => {
569-
569+
570570
at __tests__/node_assertion_error.test.js:35:10
571571
572572
assert.deepEqual
@@ -599,7 +599,7 @@ exports[`works with node assert 1`] = `
599599
40 | });
600600
41 |
601601
42 | test('assert.deepEqual with a message', () => {
602-
602+
603603
at __tests__/node_assertion_error.test.js:39:10
604604
605605
assert.deepEqual with a message
@@ -635,7 +635,7 @@ exports[`works with node assert 1`] = `
635635
44 | });
636636
45 |
637637
46 | test('assert.notDeepEqual', () => {
638-
638+
639639
at __tests__/node_assertion_error.test.js:43:10
640640
641641
assert.notDeepEqual
@@ -658,7 +658,7 @@ exports[`works with node assert 1`] = `
658658
48 | });
659659
49 |
660660
50 | test('assert.strictEqual', () => {
661-
661+
662662
at __tests__/node_assertion_error.test.js:47:10
663663
664664
assert.strictEqual
@@ -677,7 +677,7 @@ exports[`works with node assert 1`] = `
677677
52 | });
678678
53 |
679679
54 | test('assert.notStrictEqual', () => {
680-
680+
681681
at __tests__/node_assertion_error.test.js:51:10
682682
683683
assert.notStrictEqual
@@ -703,7 +703,7 @@ exports[`works with node assert 1`] = `
703703
56 | });
704704
57 |
705705
58 | test('assert.deepStrictEqual', () => {
706-
706+
707707
at __tests__/node_assertion_error.test.js:55:10
708708
709709
assert.deepStrictEqual
@@ -732,7 +732,7 @@ exports[`works with node assert 1`] = `
732732
60 | });
733733
61 |
734734
62 | test('assert.notDeepStrictEqual', () => {
735-
735+
736736
at __tests__/node_assertion_error.test.js:59:10
737737
738738
assert.notDeepStrictEqual
@@ -755,7 +755,7 @@ exports[`works with node assert 1`] = `
755755
64 | });
756756
65 |
757757
66 | test('assert.ifError', () => {
758-
758+
759759
at __tests__/node_assertion_error.test.js:63:10
760760
761761
assert.ifError
@@ -778,7 +778,7 @@ exports[`works with node assert 1`] = `
778778
72 | throw Error('err!');
779779
73 | });
780780
74 | });
781-
781+
782782
at __tests__/node_assertion_error.test.js:71:10
783783
784784
assert.throws
@@ -797,7 +797,7 @@ exports[`works with node assert 1`] = `
797797
| ^
798798
78 | });
799799
79 |
800-
800+
801801
at __tests__/node_assertion_error.test.js:77:10
802802
803803
"
@@ -825,7 +825,7 @@ exports[`works with snapshot failures 1`] = `
825825
| ^
826826
13 | });
827827
14 |
828-
828+
829829
at __tests__/snapshot.test.js:12:17
830830
831831
› 1 snapshot failed.

integration-tests/__tests__/failures.test.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ test('works with node assert', () => {
5959
72 | throw Error('err!');
6060
73 | });
6161
74 | });
62-
62+
6363
at __tests__/node_assertion_error.test.js:71:10
6464
`);
6565

@@ -109,7 +109,7 @@ test('works with node assert', () => {
109109
68 | });
110110
69 |
111111
70 | test('assert.doesNotThrow', () => {
112-
112+
113113
at __tests__/node_assertion_error.test.js:67:10
114114
`;
115115

@@ -126,8 +126,7 @@ test('works with node assert', () => {
126126
67 | assert.ifError(1);
127127
68 | });
128128
69 |
129-
130-
129+
131130
at packages/jest-jasmine2/build/jasmine/Spec.js:85:20
132131
at __tests__/node_assertion_error.test.js:66:1
133132
`;

packages/jest-message-util/src/index.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -278,14 +278,15 @@ export const formatStackTrace = (
278278
}
279279

280280
const stacktrace = lines
281+
.filter(Boolean)
281282
.map(
282283
line =>
283284
STACK_INDENT +
284285
formatPaths(config, options, relativeTestPath, trimPaths(line)),
285286
)
286287
.join('\n');
287288

288-
return renderedCallsite + stacktrace;
289+
return `${renderedCallsite}\n${stacktrace}`;
289290
};
290291

291292
export const formatResultsErrors = (

0 commit comments

Comments
 (0)