@@ -53,7 +53,7 @@ describe('Integration | coreHandlers | handleAfterSendEvent', () => {
5353 handler ( error4 , { statusCode : undefined } ) ;
5454
5555 expect ( Array . from ( replay . getContext ( ) . errorIds ) ) . toEqual ( [ 'err2' ] ) ;
56- expect ( Array . from ( replay . getContext ( ) . traceIds ) ) . toEqual ( [ ] ) ;
56+ expect ( Array . from ( replay . getContext ( ) . traceIds ) ) . toEqual ( [ [ - 1 , expect . any ( String ) ] ] ) ;
5757 } ) ;
5858
5959 it ( 'records traceIds from sent transaction events' , async ( ) => {
@@ -84,20 +84,16 @@ describe('Integration | coreHandlers | handleAfterSendEvent', () => {
8484 handler ( transaction4 , { statusCode : undefined } ) ;
8585
8686 expect ( Array . from ( replay . getContext ( ) . errorIds ) ) . toEqual ( [ ] ) ;
87- // traceIds is now a Set of [timestamp, trace_id] tuples
88- const traceIds = Array . from ( replay . getContext ( ) . traceIds ) ;
89- expect ( traceIds ) . toHaveLength ( 1 ) ;
90- expect ( traceIds [ 0 ] [ 1 ] ) . toBe ( 'tr2' ) ;
91- expect ( typeof traceIds [ 0 ] [ 0 ] ) . toBe ( 'number' ) ;
87+ const traceIds = replay . getContext ( ) . traceIds ;
88+ expect ( traceIds ) . toEqual ( [ [ expect . any ( Number ) , 'tr2' ] ] ) ;
9289
9390 // Does not affect error session
9491 await vi . advanceTimersToNextTimerAsync ( ) ;
9592
9693 expect ( Array . from ( replay . getContext ( ) . errorIds ) ) . toEqual ( [ ] ) ;
9794 // Verify traceIds are still there after advancing timers
98- const traceIdsAfter = Array . from ( replay . getContext ( ) . traceIds ) ;
99- expect ( traceIdsAfter ) . toHaveLength ( 1 ) ;
100- expect ( traceIdsAfter [ 0 ] [ 1 ] ) . toBe ( 'tr2' ) ;
95+ const traceIdsAfter = replay . getContext ( ) . traceIds ;
96+ expect ( traceIdsAfter ) . toEqual ( [ [ expect . any ( Number ) , 'tr2' ] ] ) ;
10197 expect ( replay . isEnabled ( ) ) . toBe ( true ) ;
10298 expect ( replay . isPaused ( ) ) . toBe ( false ) ;
10399 expect ( replay . recordingMode ) . toBe ( 'buffer' ) ;
@@ -126,7 +122,7 @@ describe('Integration | coreHandlers | handleAfterSendEvent', () => {
126122 . fill ( undefined )
127123 . map ( ( _ , i ) => `err-${ i } ` ) ,
128124 ) ;
129- expect ( Array . from ( replay . getContext ( ) . traceIds ) ) . toEqual ( [ ] ) ;
125+ expect ( replay . getContext ( ) . traceIds ) . toEqual ( [ [ - 1 , expect . any ( String ) ] ] ) ;
130126 } ) ;
131127
132128 it ( 'limits traceIds to max. 100' , async ( ) => {
0 commit comments