File tree 2 files changed +8
-9
lines changed
test/fixtures/test-runner/output
2 files changed +8
-9
lines changed Original file line number Diff line number Diff line change @@ -507,7 +507,6 @@ class Test extends AsyncResource {
507
507
}
508
508
509
509
if ( preventAddingSubtests ) {
510
- test . startTime = test . startTime || hrtime ( ) ;
511
510
test . fail (
512
511
new ERR_TEST_FAILURE (
513
512
'test could not be started because its parent finished' ,
@@ -537,7 +536,6 @@ class Test extends AsyncResource {
537
536
kCancelledByParent ,
538
537
) ,
539
538
) ;
540
- this . startTime = this . startTime || this . endTime ; // If a test was canceled before it was started, e.g inside a hook
541
539
this . cancelled = true ;
542
540
this . abortController . abort ( ) ;
543
541
}
@@ -763,12 +761,13 @@ class Test extends AsyncResource {
763
761
}
764
762
765
763
postRun ( pendingSubtestsError ) {
764
+ this . startTime ??= hrtime ( ) ;
765
+
766
766
// If the test was failed before it even started, then the end time will
767
767
// be earlier than the start time. Correct that here.
768
768
if ( this . endTime < this . startTime ) {
769
769
this . endTime = hrtime ( ) ;
770
770
}
771
- this . startTime ??= this . endTime ;
772
771
773
772
// The test has run, so recursively cancel any outstanding subtests and
774
773
// 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