@@ -59,11 +59,9 @@ export abstract class BaseReporter implements Reporter {
59
59
private _lastRunTimer : NodeJS . Timeout | undefined
60
60
private _lastRunCount = 0
61
61
private _timeStart = new Date ( )
62
- private _offUnhandledRejection ?: ( ) => void
63
62
64
63
constructor ( options : BaseOptions = { } ) {
65
64
this . isTTY = options . isTTY ?? ( ( isNode || isDeno ) && process . stdout ?. isTTY && ! isCI )
66
- this . registerUnhandledRejection ( )
67
65
}
68
66
69
67
get mode ( ) {
@@ -72,9 +70,6 @@ export abstract class BaseReporter implements Reporter {
72
70
73
71
onInit ( ctx : Vitest ) {
74
72
this . ctx = ctx
75
- ctx . onClose ( ( ) => {
76
- this . _offUnhandledRejection ?.( )
77
- } )
78
73
ctx . logger . printBanner ( )
79
74
this . start = performance . now ( )
80
75
}
@@ -626,22 +621,6 @@ export abstract class BaseReporter implements Reporter {
626
621
errorDivider ( )
627
622
}
628
623
}
629
-
630
- registerUnhandledRejection ( ) {
631
- const onUnhandledRejection = async ( err : unknown ) => {
632
- process . exitCode = 1
633
- this . ctx . logger . printError ( err , {
634
- fullStack : true ,
635
- type : 'Unhandled Rejection' ,
636
- } )
637
- this . ctx . logger . error ( '\n\n' )
638
- process . exit ( )
639
- }
640
- process . on ( 'unhandledRejection' , onUnhandledRejection )
641
- this . _offUnhandledRejection = ( ) => {
642
- process . off ( 'unhandledRejection' , onUnhandledRejection )
643
- }
644
- }
645
624
}
646
625
647
626
function padTitle ( str : string ) {
0 commit comments