@@ -505,6 +505,41 @@ not ok 12 - afterEach when test fails
505505 error: '1 subtest failed'
506506 code: 'ERR_TEST_FAILURE'
507507 ...
508+ # Subtest: afterEach context when test passes
509+ # Subtest: 1
510+ ok 1 - 1
511+ ---
512+ duration_ms: *
513+ ...
514+ 1..1
515+ ok 13 - afterEach context when test passes
516+ ---
517+ duration_ms: *
518+ ...
519+ # Subtest: afterEach context when test fails
520+ # Subtest: 1
521+ not ok 1 - 1
522+ ---
523+ duration_ms: *
524+ location: '/test/fixtures/test-runner/output/hooks.js:(LINE):11'
525+ failureType: 'testCodeFailure'
526+ error: 'test'
527+ code: 'ERR_TEST_FAILURE'
528+ stack: |-
529+ *
530+ *
531+ *
532+ *
533+ ...
534+ 1..1
535+ not ok 14 - afterEach context when test fails
536+ ---
537+ duration_ms: *
538+ location: '/test/fixtures/test-runner/output/hooks.js:(LINE):1'
539+ failureType: 'subtestsFailed'
540+ error: '1 subtest failed'
541+ code: 'ERR_TEST_FAILURE'
542+ ...
508543# Subtest: afterEach throws and test fails
509544 # Subtest: 1
510545 not ok 1 - 1
@@ -546,7 +581,7 @@ not ok 12 - afterEach when test fails
546581 *
547582 ...
548583 1..2
549- not ok 13 - afterEach throws and test fails
584+ not ok 15 - afterEach throws and test fails
550585 ---
551586 duration_ms: *
552587 location: '/test/fixtures/test-runner/output/hooks.js:(LINE):1'
@@ -555,7 +590,7 @@ not ok 13 - afterEach throws and test fails
555590 code: 'ERR_TEST_FAILURE'
556591 ...
557592# Subtest: t.after() is called if test body throws
558- not ok 14 - t.after() is called if test body throws
593+ not ok 16 - t.after() is called if test body throws
559594 ---
560595 duration_ms: *
561596 location: '/test/fixtures/test-runner/output/hooks.js:(LINE):1'
@@ -580,7 +615,7 @@ not ok 14 - t.after() is called if test body throws
580615 code: 'ERR_TEST_FAILURE'
581616 ...
582617 1..1
583- not ok 15 - run after when before throws
618+ not ok 17 - run after when before throws
584619 ---
585620 duration_ms: *
586621 type: 'suite'
@@ -599,15 +634,15 @@ not ok 15 - run after when before throws
599634 *
600635 *
601636 ...
602- 1..15
637+ 1..17
603638# before 1 called
604639# before 2 called
605640# after 1 called
606641# after 2 called
607- # tests 39
642+ # tests 43
608643# suites 9
609- # pass 14
610- # fail 22
644+ # pass 16
645+ # fail 24
611646# cancelled 3
612647# skipped 0
613648# todo 0
0 commit comments