File tree Expand file tree Collapse file tree 1 file changed +10
-9
lines changed Expand file tree Collapse file tree 1 file changed +10
-9
lines changed Original file line number Diff line number Diff line change @@ -709,13 +709,16 @@ class Test extends AsyncResource {
709
709
return ;
710
710
}
711
711
712
- const cancelledError = this . root . bailed ? new ERR_TEST_FAILURE (
713
- 'test bailed out' ,
714
- kTestBailedOut ,
715
- ) : new ERR_TEST_FAILURE (
716
- 'test did not finish before its parent and was cancelled' ,
717
- kCancelledByParent ,
718
- ) ;
712
+ let cancelledError ;
713
+ if ( ! error ) {
714
+ cancelledError = this . root . bailed ? new ERR_TEST_FAILURE (
715
+ 'test bailed out' ,
716
+ kTestBailedOut ,
717
+ ) : new ERR_TEST_FAILURE (
718
+ 'test did not finish before its parent and was cancelled' ,
719
+ kCancelledByParent ,
720
+ ) ;
721
+ }
719
722
720
723
this . fail ( error || cancelledError ) ;
721
724
this . cancelled = true ;
@@ -773,8 +776,6 @@ class Test extends AsyncResource {
773
776
774
777
if ( this . bail && ! this . root . bailed ) {
775
778
this . root . bailed = true ;
776
- this . bailed = true ;
777
- this . endTime ??= hrtime ( ) ;
778
779
this . root . postRun ( ) ;
779
780
}
780
781
}
You can’t perform that action at this time.
0 commit comments