Skip to content

Commit 7ed2886

Browse files
committed
trim moar
1 parent 89150e8 commit 7ed2886

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
@@ -416,7 +416,7 @@ exports[`works with named snapshot failures 1`] = `
416416
| ^
417417
13 | });
418418
14 |
419-
419+
420420
at __tests__/snapshot_named.test.js:12:17
421421
422422
› 1 snapshot failed.
@@ -458,7 +458,7 @@ exports[`works with node assert 1`] = `
458458
16 | });
459459
17 |
460460
18 | test('assert with a message', () => {
461-
461+
462462
at __tests__/node_assertion_error.test.js:15:3
463463
464464
assert with a message
@@ -480,7 +480,7 @@ exports[`works with node assert 1`] = `
480480
20 | });
481481
21 |
482482
22 | test('assert.ok', () => {
483-
483+
484484
at __tests__/node_assertion_error.test.js:19:3
485485
486486
assert.ok
@@ -499,7 +499,7 @@ exports[`works with node assert 1`] = `
499499
24 | });
500500
25 |
501501
26 | test('assert.ok with a message', () => {
502-
502+
503503
at __tests__/node_assertion_error.test.js:23:10
504504
505505
assert.ok with a message
@@ -521,7 +521,7 @@ exports[`works with node assert 1`] = `
521521
28 | });
522522
29 |
523523
30 | test('assert.equal', () => {
524-
524+
525525
at __tests__/node_assertion_error.test.js:27:10
526526
527527
assert.equal
@@ -540,7 +540,7 @@ exports[`works with node assert 1`] = `
540540
32 | });
541541
33 |
542542
34 | test('assert.notEqual', () => {
543-
543+
544544
at __tests__/node_assertion_error.test.js:31:10
545545
546546
assert.notEqual
@@ -563,7 +563,7 @@ exports[`works with node assert 1`] = `
563563
36 | });
564564
37 |
565565
38 | test('assert.deepEqual', () => {
566-
566+
567567
at __tests__/node_assertion_error.test.js:35:10
568568
569569
assert.deepEqual
@@ -596,7 +596,7 @@ exports[`works with node assert 1`] = `
596596
40 | });
597597
41 |
598598
42 | test('assert.deepEqual with a message', () => {
599-
599+
600600
at __tests__/node_assertion_error.test.js:39:10
601601
602602
assert.deepEqual with a message
@@ -632,7 +632,7 @@ exports[`works with node assert 1`] = `
632632
44 | });
633633
45 |
634634
46 | test('assert.notDeepEqual', () => {
635-
635+
636636
at __tests__/node_assertion_error.test.js:43:10
637637
638638
assert.notDeepEqual
@@ -655,7 +655,7 @@ exports[`works with node assert 1`] = `
655655
48 | });
656656
49 |
657657
50 | test('assert.strictEqual', () => {
658-
658+
659659
at __tests__/node_assertion_error.test.js:47:10
660660
661661
assert.strictEqual
@@ -674,7 +674,7 @@ exports[`works with node assert 1`] = `
674674
52 | });
675675
53 |
676676
54 | test('assert.notStrictEqual', () => {
677-
677+
678678
at __tests__/node_assertion_error.test.js:51:10
679679
680680
assert.notStrictEqual
@@ -700,7 +700,7 @@ exports[`works with node assert 1`] = `
700700
56 | });
701701
57 |
702702
58 | test('assert.deepStrictEqual', () => {
703-
703+
704704
at __tests__/node_assertion_error.test.js:55:10
705705
706706
assert.deepStrictEqual
@@ -729,7 +729,7 @@ exports[`works with node assert 1`] = `
729729
60 | });
730730
61 |
731731
62 | test('assert.notDeepStrictEqual', () => {
732-
732+
733733
at __tests__/node_assertion_error.test.js:59:10
734734
735735
assert.notDeepStrictEqual
@@ -752,7 +752,7 @@ exports[`works with node assert 1`] = `
752752
64 | });
753753
65 |
754754
66 | test('assert.ifError', () => {
755-
755+
756756
at __tests__/node_assertion_error.test.js:63:10
757757
758758
assert.ifError
@@ -775,7 +775,7 @@ exports[`works with node assert 1`] = `
775775
72 | throw Error('err!');
776776
73 | });
777777
74 | });
778-
778+
779779
at __tests__/node_assertion_error.test.js:71:10
780780
781781
assert.throws
@@ -794,7 +794,7 @@ exports[`works with node assert 1`] = `
794794
| ^
795795
78 | });
796796
79 |
797-
797+
798798
at __tests__/node_assertion_error.test.js:77:10
799799
800800
"
@@ -819,7 +819,7 @@ exports[`works with snapshot failures 1`] = `
819819
| ^
820820
13 | });
821821
14 |
822-
822+
823823
at __tests__/snapshot.test.js:12:17
824824
825825
› 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)