@@ -68,6 +68,96 @@ exports[`not throwing Error objects 4`] = `
68
68
"
69
69
`;
70
70
71
+ exports [` not throwing Error objects 5` ] = `
72
+ "FAIL __tests__/during_tests.test.js
73
+ ✕ Promise thrown during test
74
+ ✕ Boolean thrown during test
75
+ ✕ undefined thrown during test
76
+ ✕ Object thrown during test
77
+ ✕ Error during test
78
+ ✕ done(Error)
79
+ ✕ done(non-error)
80
+
81
+ ● Promise thrown during test
82
+
83
+ thrown: Promise { }
84
+
85
+ at packages/jest-jasmine2/build/expectation_result_factory.js:42:47
86
+
87
+ ● Boolean thrown during test
88
+
89
+ thrown: false
90
+
91
+ at packages/jest-jasmine2/build/expectation_result_factory.js:42:47
92
+
93
+ ● undefined thrown during test
94
+
95
+ thrown: undefined
96
+
97
+ at packages/jest-jasmine2/build/expectation_result_factory.js:42:47
98
+
99
+ ● Object thrown during test
100
+
101
+ thrown: Object {
102
+ \\" notAnError\\ " : Array [
103
+ Object {
104
+ \\" hello\\ " : true ,
105
+ \\" tooDeep\\ " : [Object ],
106
+ },
107
+ ],
108
+ }
109
+
110
+ at packages/jest-jasmine2/build/expectation_result_factory.js:42:47
111
+
112
+ ● Error during test
113
+
114
+ ReferenceError: doesNotExist is not defined
115
+
116
+ 26 | test('Error during test', () => {
117
+ 27 | // eslint-disable-next-line no-undef
118
+ > 28 | doesNotExist .alsoThisNot ;
119
+ 29 | } );
120
+ 30 |
121
+ 31 | test('done(Error)', done => {
122
+
123
+ at __tests__ / during_tests .test .js :28 :3
124
+
125
+ ● done (Error )
126
+
127
+ this is an error
128
+
129
+ 30 |
130
+ 31 | test (' done(Error)' , done => {
131
+ > 32 | done (new Error (' this is an error' ));
132
+ 33 | });
133
+ 34 |
134
+ 35 | test (' done(non-error)' , done => {
135
+
136
+ at __tests__ / during_tests .test .js :32 :8
137
+
138
+ ● done (non - error )
139
+
140
+ Failed : Object {
141
+ \\" notAnError\\ " : Array [
142
+ Object {
143
+ \\" hello\\ " : true ,
144
+ \\" tooDeep\\ " : [Object ],
145
+ },
146
+ ],
147
+ }
148
+
149
+ 34 |
150
+ 35 | test (' done(non-error)' , done => {
151
+ > 36 | done (deepObject );
152
+ 37 | });
153
+ 38 |
154
+
155
+ at packages / jest - jasmine2 / build / expectation_result_factory .js :42 :47
156
+ at __tests__ / during_tests .test .js :36 :3
157
+
158
+ "
159
+ `;
160
+
71
161
exports [` works with assertions in separate files 1` ] = `
72
162
"FAIL __tests__/test_macro.test.js
73
163
✕ use some imported macro to make assertion
@@ -142,7 +232,7 @@ exports[`works with node assert 1`] = `
142
232
143
233
● assert
144
234
145
- assert.equal(received, expected) or assert(received)
235
+ thrown: \\ " assert.equal(received, expected) or assert(received)
146
236
147
237
Expected value to be (operator: ==):
148
238
true
@@ -160,7 +250,7 @@ exports[`works with node assert 1`] = `
160
250
161
251
● assert with a message
162
252
163
- assert .equal (received , expected ) or assert (received )
253
+ thrown : \\ " assert.equal(received, expected) or assert(received)
164
254
165
255
Expected value to be (operator : == ):
166
256
true
@@ -181,7 +271,7 @@ exports[`works with node assert 1`] = `
181
271
182
272
● assert .ok
183
273
184
- assert .equal (received , expected ) or assert (received )
274
+ thrown : \\ " assert.equal(received, expected) or assert(received)
185
275
186
276
Expected value to be (operator : == ):
187
277
true
@@ -199,7 +289,7 @@ exports[`works with node assert 1`] = `
199
289
200
290
● assert .ok with a message
201
291
202
- assert .equal (received , expected ) or assert (received )
292
+ thrown : \\ " assert.equal(received, expected) or assert(received)
203
293
204
294
Expected value to be (operator : == ):
205
295
true
@@ -220,7 +310,7 @@ exports[`works with node assert 1`] = `
220
310
221
311
● assert .equal
222
312
223
- assert .equal (received , expected ) or assert (received )
313
+ thrown : \\ " assert.equal(received, expected) or assert(received)
224
314
225
315
Expected value to be (operator : == ):
226
316
2
@@ -238,7 +328,7 @@ exports[`works with node assert 1`] = `
238
328
239
329
● assert .notEqual
240
330
241
- assert .notEqual (received , expected )
331
+ thrown : \\ " assert.notEqual(received, expected)
242
332
243
333
Expected value not to be (operator : != ):
244
334
1
@@ -260,23 +350,23 @@ exports[`works with node assert 1`] = `
260
350
261
351
● assert .deepEqual
262
352
263
- assert .deepEqual (received , expected )
353
+ thrown : \\ " assert.deepEqual(received, expected)
264
354
265
355
Expected value to deeply equal to :
266
- {\\" a\\ " : {\\" b\\ " : {\\" c \\ " : 6 }}}
356
+ {\\\\\\ " a\\\\\\ " : {\\\\\\ " b\\\\\\ " : {\\\\\\ " c \\\\ \\" : 6 }}}
267
357
Received :
268
- {\\" a\\ " : {\\" b\\ " : {\\" c \\ " : 5 }}}
358
+ {\\\\\\ " a\\\\\\ " : {\\\\\\ " b\\\\\\ " : {\\\\\\ " c \\\\ \\" : 5 }}}
269
359
270
360
Difference :
271
361
272
362
- Expected
273
363
+ Received
274
364
275
365
Object {
276
- \\" a \\ " : Object {
277
- \\" b \\ " : Object {
278
- - \\" c \\ " : 6 ,
279
- + \\" c \\ " : 5 ,
366
+ \\\\\\ " a \\\\ \\" : Object {
367
+ \\\\\\ " b \\\\ \\" : Object {
368
+ - \\\\\\ " c \\\\ \\" : 6 ,
369
+ + \\\\\\ " c \\\\ \\" : 5 ,
280
370
},
281
371
},
282
372
}
@@ -292,12 +382,12 @@ exports[`works with node assert 1`] = `
292
382
293
383
● assert .deepEqual with a message
294
384
295
- assert .deepEqual (received , expected )
385
+ thrown : \\ " assert.deepEqual(received, expected)
296
386
297
387
Expected value to deeply equal to :
298
- {\\" a\\ " : {\\" b\\ " : {\\" c \\ " : 7 }}}
388
+ {\\\\\\ " a\\\\\\ " : {\\\\\\ " b\\\\\\ " : {\\\\\\ " c \\\\ \\" : 7 }}}
299
389
Received :
300
- {\\" a\\ " : {\\" b\\ " : {\\" c \\ " : 5 }}}
390
+ {\\\\\\ " a\\\\\\ " : {\\\\\\ " b\\\\\\ " : {\\\\\\ " c \\\\ \\" : 5 }}}
301
391
302
392
Message :
303
393
this is a message
@@ -308,10 +398,10 @@ exports[`works with node assert 1`] = `
308
398
+ Received
309
399
310
400
Object {
311
- \\" a \\ " : Object {
312
- \\" b \\ " : Object {
313
- - \\" c \\ " : 7 ,
314
- + \\" c \\ " : 5 ,
401
+ \\\\\\ " a \\\\ \\" : Object {
402
+ \\\\\\ " b \\\\ \\" : Object {
403
+ - \\\\\\ " c \\\\ \\" : 7 ,
404
+ + \\\\\\ " c \\\\ \\" : 5 ,
315
405
},
316
406
},
317
407
}
@@ -327,12 +417,12 @@ exports[`works with node assert 1`] = `
327
417
328
418
● assert .notDeepEqual
329
419
330
- assert .notDeepEqual (received , expected )
420
+ thrown : \\ " assert.notDeepEqual(received, expected)
331
421
332
422
Expected value not to deeply equal to :
333
- {\\" a \\ " : 1 }
423
+ {\\\\\\ " a \\\\ \\" : 1 }
334
424
Received :
335
- {\\" a \\ " : 1 }
425
+ {\\\\\\ " a \\\\ \\" : 1 }
336
426
337
427
Difference :
338
428
@@ -349,7 +439,7 @@ exports[`works with node assert 1`] = `
349
439
350
440
● assert .strictEqual
351
441
352
- assert .strictEqual (received , expected )
442
+ thrown : \\ " assert.strictEqual(received, expected)
353
443
354
444
Expected value to be (operator : === ):
355
445
NaN
@@ -367,7 +457,7 @@ exports[`works with node assert 1`] = `
367
457
368
458
● assert .notStrictEqual
369
459
370
- assert .notStrictEqual (received , expected )
460
+ thrown : \\ " assert.notStrictEqual(received, expected)
371
461
372
462
Expected value not to be (operator : !== ):
373
463
1
@@ -392,21 +482,21 @@ exports[`works with node assert 1`] = `
392
482
393
483
● assert .deepStrictEqual
394
484
395
- assert .deepStrictEqual (received , expected )
485
+ thrown : \\ " assert.deepStrictEqual(received, expected)
396
486
397
487
Expected value to deeply and strictly equal to :
398
- {\\" a \\ " : 2 }
488
+ {\\\\\\ " a \\\\ \\" : 2 }
399
489
Received :
400
- {\\" a \\ " : 1 }
490
+ {\\\\\\ " a \\\\ \\" : 1 }
401
491
402
492
Difference :
403
493
404
494
- Expected
405
495
+ Received
406
496
407
497
Object {
408
- - \\" a \\ " : 2 ,
409
- + \\" a \\ " : 1 ,
498
+ - \\\\\\ " a \\\\ \\" : 2 ,
499
+ + \\\\\\ " a \\\\ \\" : 1 ,
410
500
}
411
501
412
502
57 |
@@ -420,12 +510,12 @@ exports[`works with node assert 1`] = `
420
510
421
511
● assert .notDeepStrictEqual
422
512
423
- assert .notDeepStrictEqual (received , expected )
513
+ thrown : \\ " assert.notDeepStrictEqual(received, expected)
424
514
425
515
Expected value not to deeply and strictly equal to :
426
- {\\" a \\ " : 1 }
516
+ {\\\\\\ " a \\\\ \\" : 1 }
427
517
Received :
428
- {\\" a \\ " : 1 }
518
+ {\\\\\\ " a \\\\ \\" : 1 }
429
519
430
520
Difference :
431
521
@@ -442,12 +532,13 @@ exports[`works with node assert 1`] = `
442
532
443
533
● assert .ifError
444
534
445
- Error
446
- 1 thrown
535
+ thrown : 1
536
+
537
+ at packages / jest - jasmine2 / build / expectation_result_factory .js :42 :47
447
538
448
539
● assert .doesNotThrow
449
540
450
- assert .doesNotThrow (function )
541
+ thrown : \\ " assert.doesNotThrow(function)
451
542
452
543
Expected the function not to throw an error.
453
544
Instead, it threw:
@@ -467,7 +558,7 @@ exports[`works with node assert 1`] = `
467
558
468
559
● assert .throws
469
560
470
- assert .throws (function )
561
+ thrown : \\ " assert.throws(function)
471
562
472
563
Expected the function to throw an error.
473
564
But it didn't throw anything.
0 commit comments