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 @@ -773,13 +773,16 @@ class Test extends AsyncResource {
773773 return ;
774774 }
775775
776- const cancelledError = this . root . bailed ? new ERR_TEST_FAILURE (
777- 'test bailed out' ,
778- kTestBailedOut ,
779- ) : new ERR_TEST_FAILURE (
780- 'test did not finish before its parent and was cancelled' ,
781- kCancelledByParent ,
782- ) ;
776+ let cancelledError ;
777+ if ( ! error ) {
778+ cancelledError = this . root . bailed ? new ERR_TEST_FAILURE (
779+ 'test bailed out' ,
780+ kTestBailedOut ,
781+ ) : new ERR_TEST_FAILURE (
782+ 'test did not finish before its parent and was cancelled' ,
783+ kCancelledByParent ,
784+ ) ;
785+ }
783786
784787 this . fail ( error || cancelledError ) ;
785788 this . cancelled = true ;
@@ -837,8 +840,6 @@ class Test extends AsyncResource {
837840
838841 if ( this . bail && ! this . root . bailed ) {
839842 this . root . bailed = true ;
840- this . bailed = true ;
841- this . endTime ??= hrtime ( ) ;
842843 this . root . postRun ( ) ;
843844 }
844845 }
You can’t perform that action at this time.
0 commit comments