@@ -34,6 +34,12 @@ ok 1 - describe hooks
34
34
duration_ms: *
35
35
type: 'suite'
36
36
...
37
+ # Subtest: describe hooks - no subtests
38
+ ok 2 - describe hooks - no subtests
39
+ ---
40
+ duration_ms: *
41
+ type: 'suite'
42
+ ...
37
43
# Subtest: before throws
38
44
# Subtest: 1
39
45
not ok 1 - 1
@@ -54,7 +60,27 @@ ok 1 - describe hooks
54
60
code: 'ERR_TEST_FAILURE'
55
61
...
56
62
1..2
57
- not ok 2 - before throws
63
+ not ok 3 - before throws
64
+ ---
65
+ duration_ms: *
66
+ type: 'suite'
67
+ location: '/test/fixtures/test-runner/output/hooks.js:(LINE):1'
68
+ failureType: 'hookFailed'
69
+ error: 'before'
70
+ code: 'ERR_TEST_FAILURE'
71
+ stack: |-
72
+ *
73
+ *
74
+ *
75
+ *
76
+ *
77
+ *
78
+ *
79
+ *
80
+ *
81
+ ...
82
+ # Subtest: before throws - no subtests
83
+ not ok 4 - before throws - no subtests
58
84
---
59
85
duration_ms: *
60
86
type: 'suite'
@@ -85,7 +111,27 @@ not ok 2 - before throws
85
111
duration_ms: *
86
112
...
87
113
1..2
88
- not ok 3 - after throws
114
+ not ok 5 - after throws
115
+ ---
116
+ duration_ms: *
117
+ type: 'suite'
118
+ location: '/test/fixtures/test-runner/output/hooks.js:(LINE):1'
119
+ failureType: 'hookFailed'
120
+ error: 'after'
121
+ code: 'ERR_TEST_FAILURE'
122
+ stack: |-
123
+ *
124
+ *
125
+ *
126
+ *
127
+ *
128
+ *
129
+ *
130
+ *
131
+ *
132
+ ...
133
+ # Subtest: after throws - no subtests
134
+ not ok 6 - after throws - no subtests
89
135
---
90
136
duration_ms: *
91
137
type: 'suite'
@@ -144,7 +190,7 @@ not ok 3 - after throws
144
190
*
145
191
...
146
192
1..2
147
- not ok 4 - beforeEach throws
193
+ not ok 7 - beforeEach throws
148
194
---
149
195
duration_ms: *
150
196
type: 'suite'
@@ -194,7 +240,7 @@ not ok 4 - beforeEach throws
194
240
*
195
241
...
196
242
1..2
197
- not ok 5 - afterEach throws
243
+ not ok 8 - afterEach throws
198
244
---
199
245
duration_ms: *
200
246
type: 'suite'
@@ -230,7 +276,7 @@ not ok 5 - afterEach throws
230
276
duration_ms: *
231
277
...
232
278
1..2
233
- not ok 6 - afterEach when test fails
279
+ not ok 9 - afterEach when test fails
234
280
---
235
281
duration_ms: *
236
282
type: 'suite'
@@ -280,7 +326,7 @@ not ok 6 - afterEach when test fails
280
326
*
281
327
...
282
328
1..2
283
- not ok 7 - afterEach throws and test fails
329
+ not ok 10 - afterEach throws and test fails
284
330
---
285
331
duration_ms: *
286
332
type: 'suite'
@@ -317,7 +363,12 @@ not ok 7 - afterEach throws and test fails
317
363
duration_ms: *
318
364
...
319
365
1..3
320
- ok 8 - test hooks
366
+ ok 11 - test hooks
367
+ ---
368
+ duration_ms: *
369
+ ...
370
+ # Subtest: test hooks - no subtests
371
+ ok 12 - test hooks - no subtests
321
372
---
322
373
duration_ms: *
323
374
...
@@ -363,13 +414,95 @@ ok 8 - test hooks
363
414
*
364
415
...
365
416
1..2
366
- not ok 9 - t.before throws
417
+ not ok 13 - t.before throws
367
418
---
368
419
duration_ms: *
369
420
location: '/test/fixtures/test-runner/output/hooks.js:(LINE):1'
370
- failureType: 'subtestsFailed '
371
- error: '2 subtests failed '
421
+ failureType: 'testCodeFailure '
422
+ error: 'before '
372
423
code: 'ERR_TEST_FAILURE'
424
+ stack: |-
425
+ *
426
+ *
427
+ *
428
+ *
429
+ *
430
+ *
431
+ *
432
+ *
433
+ *
434
+ *
435
+ ...
436
+ # Subtest: t.before throws - no subtests
437
+ not ok 14 - t.before throws - no subtests
438
+ ---
439
+ duration_ms: *
440
+ location: '/test/fixtures/test-runner/output/hooks.js:(LINE):1'
441
+ failureType: 'testCodeFailure'
442
+ error: 'before'
443
+ code: 'ERR_TEST_FAILURE'
444
+ stack: |-
445
+ *
446
+ *
447
+ *
448
+ *
449
+ *
450
+ *
451
+ *
452
+ *
453
+ *
454
+ *
455
+ ...
456
+ # Subtest: t.after throws
457
+ # Subtest: 1
458
+ ok 1 - 1
459
+ ---
460
+ duration_ms: *
461
+ ...
462
+ # Subtest: 2
463
+ ok 2 - 2
464
+ ---
465
+ duration_ms: *
466
+ ...
467
+ 1..2
468
+ not ok 15 - t.after throws
469
+ ---
470
+ duration_ms: *
471
+ location: '/test/fixtures/test-runner/output/hooks.js:(LINE):1'
472
+ failureType: 'hookFailed'
473
+ error: 'after'
474
+ code: 'ERR_TEST_FAILURE'
475
+ stack: |-
476
+ *
477
+ *
478
+ *
479
+ *
480
+ *
481
+ *
482
+ *
483
+ *
484
+ *
485
+ *
486
+ ...
487
+ # Subtest: t.after throws - no subtests
488
+ not ok 16 - t.after throws - no subtests
489
+ ---
490
+ duration_ms: *
491
+ location: '/test/fixtures/test-runner/output/hooks.js:(LINE):1'
492
+ failureType: 'hookFailed'
493
+ error: 'after'
494
+ code: 'ERR_TEST_FAILURE'
495
+ stack: |-
496
+ *
497
+ *
498
+ *
499
+ *
500
+ *
501
+ *
502
+ *
503
+ *
504
+ *
505
+ *
373
506
...
374
507
# Subtest: t.beforeEach throws
375
508
# Subtest: 1
@@ -413,7 +546,7 @@ not ok 9 - t.before throws
413
546
*
414
547
...
415
548
1..2
416
- not ok 10 - t.beforeEach throws
549
+ not ok 17 - t.beforeEach throws
417
550
---
418
551
duration_ms: *
419
552
location: '/test/fixtures/test-runner/output/hooks.js:(LINE):1'
@@ -463,7 +596,7 @@ not ok 10 - t.beforeEach throws
463
596
*
464
597
...
465
598
1..2
466
- not ok 11 - t.afterEach throws
599
+ not ok 18 - t.afterEach throws
467
600
---
468
601
duration_ms: *
469
602
location: '/test/fixtures/test-runner/output/hooks.js:(LINE):1'
@@ -497,7 +630,7 @@ not ok 11 - t.afterEach throws
497
630
duration_ms: *
498
631
...
499
632
1..2
500
- not ok 12 - afterEach when test fails
633
+ not ok 19 - afterEach when test fails
501
634
---
502
635
duration_ms: *
503
636
location: '/test/fixtures/test-runner/output/hooks.js:(LINE):1'
@@ -512,7 +645,7 @@ not ok 12 - afterEach when test fails
512
645
duration_ms: *
513
646
...
514
647
1..1
515
- ok 13 - afterEach context when test passes
648
+ ok 20 - afterEach context when test passes
516
649
---
517
650
duration_ms: *
518
651
...
@@ -532,7 +665,7 @@ ok 13 - afterEach context when test passes
532
665
*
533
666
...
534
667
1..1
535
- not ok 14 - afterEach context when test fails
668
+ not ok 21 - afterEach context when test fails
536
669
---
537
670
duration_ms: *
538
671
location: '/test/fixtures/test-runner/output/hooks.js:(LINE):1'
@@ -581,7 +714,7 @@ not ok 14 - afterEach context when test fails
581
714
*
582
715
...
583
716
1..2
584
- not ok 15 - afterEach throws and test fails
717
+ not ok 22 - afterEach throws and test fails
585
718
---
586
719
duration_ms: *
587
720
location: '/test/fixtures/test-runner/output/hooks.js:(LINE):1'
@@ -590,7 +723,7 @@ not ok 15 - afterEach throws and test fails
590
723
code: 'ERR_TEST_FAILURE'
591
724
...
592
725
# Subtest: t.after() is called if test body throws
593
- not ok 16 - t.after() is called if test body throws
726
+ not ok 23 - t.after() is called if test body throws
594
727
---
595
728
duration_ms: *
596
729
location: '/test/fixtures/test-runner/output/hooks.js:(LINE):1'
@@ -615,7 +748,7 @@ not ok 16 - t.after() is called if test body throws
615
748
code: 'ERR_TEST_FAILURE'
616
749
...
617
750
1..1
618
- not ok 17 - run after when before throws
751
+ not ok 24 - run after when before throws
619
752
---
620
753
duration_ms: *
621
754
type: 'suite'
@@ -634,15 +767,15 @@ not ok 17 - run after when before throws
634
767
*
635
768
*
636
769
...
637
- 1..17
770
+ 1..24
638
771
# before 1 called
639
772
# before 2 called
640
773
# after 1 called
641
774
# after 2 called
642
- # tests 43
643
- # suites 9
644
- # pass 16
645
- # fail 24
775
+ # tests 49
776
+ # suites 12
777
+ # pass 19
778
+ # fail 27
646
779
# cancelled 3
647
780
# skipped 0
648
781
# todo 0
0 commit comments