@@ -147,7 +147,6 @@ class MyReporter {
147
147
148
148
. on ( EVENT_TEST_PENDING , async ( test ) => {
149
149
if ( this . testObservability == true ) {
150
- test . isSkipped = true ;
151
150
if ( ! test . testAnalyticsId ) test . testAnalyticsId = uuidv4 ( ) ;
152
151
if ( ! this . runStatusMarkedHash [ test . testAnalyticsId ] ) {
153
152
this . runStatusMarkedHash [ test . testAnalyticsId ] = true ;
@@ -451,14 +450,20 @@ class MyReporter {
451
450
// Send pending hook finsihed events for hook starts
452
451
if ( eventType === 'TestRunFinished' ) {
453
452
Object . values ( this . hooksStarted ) . forEach ( async hookData => {
454
- hookData [ 'hook_run' ] . finished_at = hookData [ 'hook_run' ] . started_at ;
455
- hookData [ 'hook_run' ] . duration = 0 ;
453
+ hookData [ 'event_type' ] = 'HookRunFinished' ;
456
454
hookData [ 'hook_run' ] . result = uploadData [ 'test_run' ] . result ;
457
455
hookData [ 'hook_run' ] . failure = uploadData [ 'test_run' ] . failure ;
458
456
hookData [ 'hook_run' ] . failure_type = uploadData [ 'test_run' ] . failure_type ;
459
457
hookData [ 'hook_run' ] . failure_reason = uploadData [ 'test_run' ] . failure_reason ;
460
458
hookData [ 'hook_run' ] . failure_reason_expanded = uploadData [ 'test_run' ] . failure_reason_expanded ;
461
459
hookData [ 'hook_run' ] . failure_backtrace = uploadData [ 'test_run' ] . failure_backtrace ;
460
+ if ( hookData [ 'hook_run' ] [ 'hook_type' ] === 'BEFORE_ALL' ) {
461
+ hookData [ 'hook_run' ] . finished_at = uploadData [ 'test_run' ] . finished_at ;
462
+ hookData [ 'hook_run' ] . duration_in_ms = new Date ( hookData [ 'hook_run' ] . finished_at ) . getTime ( ) - new Date ( hookData [ 'hook_run' ] . started_at ) . getTime ( ) ;
463
+ } else {
464
+ hookData [ 'hook_run' ] . finished_at = hookData [ 'hook_run' ] . started_at ;
465
+ hookData [ 'hook_run' ] . duration_in_ms = 0 ;
466
+ }
462
467
await uploadEventData ( hookData ) ;
463
468
} )
464
469
this . hooksStarted = { } ;
0 commit comments