@@ -88,13 +88,15 @@ class MyReporter {
88
88
} )
89
89
90
90
. on ( EVENT_HOOK_BEGIN , async ( hook ) => {
91
+ debugOnConsole ( `[MOCHA EVENT] EVENT_HOOK_BEGIN` ) ;
91
92
if ( this . testObservability == true ) {
92
93
if ( ! hook . hookAnalyticsId ) {
93
94
hook . hookAnalyticsId = uuidv4 ( ) ;
94
95
} else if ( this . runStatusMarkedHash [ hook . hookAnalyticsId ] ) {
95
96
delete this . runStatusMarkedHash [ hook . hookAnalyticsId ] ;
96
97
hook . hookAnalyticsId = uuidv4 ( ) ;
97
98
}
99
+ debugOnConsole ( `[MOCHA EVENT] EVENT_HOOK_BEGIN for uuid: ${ hook . hookAnalyticsId } ` ) ;
98
100
hook . hook_started_at = ( new Date ( ) ) . toISOString ( ) ;
99
101
hook . started_at = ( new Date ( ) ) . toISOString ( ) ;
100
102
this . current_hook = hook ;
@@ -103,6 +105,7 @@ class MyReporter {
103
105
} )
104
106
105
107
. on ( EVENT_HOOK_END , async ( hook ) => {
108
+ debugOnConsole ( `[MOCHA EVENT] EVENT_HOOK_END` ) ;
106
109
if ( this . testObservability == true ) {
107
110
if ( ! this . runStatusMarkedHash [ hook . hookAnalyticsId ] ) {
108
111
if ( ! hook . hookAnalyticsId ) {
@@ -115,6 +118,9 @@ class MyReporter {
115
118
116
119
// Remove hooks added at hook start
117
120
delete this . hooksStarted [ hook . hookAnalyticsId ] ;
121
+
122
+ debugOnConsole ( `[MOCHA EVENT] EVENT_HOOK_END for uuid: ${ hook . hookAnalyticsId } ` ) ;
123
+
118
124
await this . sendTestRunEvent ( hook , undefined , false , "HookRunFinished" ) ;
119
125
}
120
126
}
@@ -185,10 +191,12 @@ class MyReporter {
185
191
186
192
. once ( EVENT_RUN_END , async ( ) => {
187
193
try {
194
+ debugOnConsole ( `[MOCHA EVENT] EVENT_RUN_END` ) ;
188
195
if ( this . testObservability == true ) {
189
196
const hookSkippedTests = getHookSkippedTests ( this . runner . suite ) ;
190
197
for ( const test of hookSkippedTests ) {
191
198
if ( ! test . testAnalyticsId ) test . testAnalyticsId = uuidv4 ( ) ;
199
+ debugOnConsole ( `[MOCHA EVENT] EVENT_RUN_END TestRunSkipped for uuid: ${ test . testAnalyticsId } ` ) ;
192
200
await this . sendTestRunEvent ( test , undefined , false , "TestRunSkipped" ) ;
193
201
}
194
202
}
@@ -390,6 +398,7 @@ class MyReporter {
390
398
mapTestHooks ( test ) ;
391
399
}
392
400
} catch ( e ) {
401
+ debugOnConsole ( `Exception in processing hook data for event ${ eventType } with error : ${ e } ` ) ;
393
402
debug ( `Exception in processing hook data for event ${ eventType } with error : ${ e } ` , true , e ) ;
394
403
}
395
404
@@ -486,6 +495,7 @@ class MyReporter {
486
495
this . hooksStarted = { } ;
487
496
}
488
497
} catch ( error ) {
498
+ debugOnConsole ( `Exception in populating test data for event ${ eventType } with error : ${ error } ` ) ;
489
499
debug ( `Exception in populating test data for event ${ eventType } with error : ${ error } ` , true , error ) ;
490
500
}
491
501
}
0 commit comments