File tree Expand file tree Collapse file tree 2 files changed +8
-9
lines changed
test/fixtures/test-runner/output Expand file tree Collapse file tree 2 files changed +8
-9
lines changed Original file line number Diff line number Diff line change @@ -454,7 +454,6 @@ class Test extends AsyncResource {
454
454
}
455
455
456
456
if ( preventAddingSubtests ) {
457
- test . startTime = test . startTime || hrtime ( ) ;
458
457
test . fail (
459
458
new ERR_TEST_FAILURE (
460
459
'test could not be started because its parent finished' ,
@@ -484,7 +483,6 @@ class Test extends AsyncResource {
484
483
kCancelledByParent ,
485
484
) ,
486
485
) ;
487
- this . startTime = this . startTime || this . endTime ; // If a test was canceled before it was started, e.g inside a hook
488
486
this . cancelled = true ;
489
487
this . abortController . abort ( ) ;
490
488
}
@@ -700,12 +698,13 @@ class Test extends AsyncResource {
700
698
}
701
699
702
700
postRun ( pendingSubtestsError ) {
701
+ this . startTime ??= hrtime ( ) ;
702
+
703
703
// If the test was failed before it even started, then the end time will
704
704
// be earlier than the start time. Correct that here.
705
705
if ( this . endTime < this . startTime ) {
706
706
this . endTime = hrtime ( ) ;
707
707
}
708
- this . startTime ??= this . endTime ;
709
708
710
709
// The test has run, so recursively cancel any outstanding subtests and
711
710
// mark this test as failed if any subtests failed.
Original file line number Diff line number Diff line change 11
11
12
12
describe hooks - no subtests (*ms)
13
13
before throws
14
- 1
14
+ 1 (*ms)
15
15
'test did not finish before its parent and was cancelled'
16
16
17
- 2
17
+ 2 (*ms)
18
18
'test did not finish before its parent and was cancelled'
19
19
20
20
before throws (*ms)
390
390
391
391
- after() called
392
392
run after when before throws
393
- 1
393
+ 1 (*ms)
394
394
'test did not finish before its parent and was cancelled'
395
395
396
396
run after when before throws (*ms)
422
422
failing tests:
423
423
424
424
*
425
- 1
425
+ 1 (*ms)
426
426
'test did not finish before its parent and was cancelled'
427
427
428
428
*
429
- 2
429
+ 2 (*ms)
430
430
'test did not finish before its parent and was cancelled'
431
431
432
432
*
772
772
*
773
773
774
774
*
775
- 1
775
+ 1 (*ms)
776
776
'test did not finish before its parent and was cancelled'
777
777
778
778
*
You can’t perform that action at this time.
0 commit comments