@@ -129,21 +129,23 @@ function checkCallForSentReplay(
129129}
130130
131131/**
132- * Only want calls that send replay events, i.e. ignore error events
133- */
132+ * Only want calls that send replay events, i.e. ignore error events
133+ */
134134function getReplayCalls ( calls : any [ ] [ ] [ ] ) : any [ ] [ ] [ ] {
135- return calls . map ( call => {
136- const arg = call [ 0 ] ;
135+ return calls
136+ . map ( call => {
137+ const arg = call [ 0 ] ;
137138 if ( arg . length !== 2 ) {
138139 return [ ] ;
139140 }
140141
141- if ( ! arg [ 1 ] [ 0 ] . find ( ( { type} : { type : string } ) => [ 'replay_event' , 'replay_recording' ] . includes ( type ) ) ) {
142+ if ( ! arg [ 1 ] [ 0 ] . find ( ( { type } : { type : string } ) => [ 'replay_event' , 'replay_recording' ] . includes ( type ) ) ) {
142143 return [ ] ;
143144 }
144145
145- return [ arg ] ;
146- } ) . filter ( Boolean ) ;
146+ return [ arg ] ;
147+ } )
148+ . filter ( Boolean ) ;
147149}
148150
149151/**
@@ -159,9 +161,11 @@ const toHaveSentReplay = function (
159161
160162 let result : CheckCallForSentReplayResult ;
161163
162- const expectedKeysLength = expected ? ( 'sample' in expected ? Object . keys ( expected . sample ) : Object . keys ( expected ) ) . length : 0 ;
164+ const expectedKeysLength = expected
165+ ? ( 'sample' in expected ? Object . keys ( expected . sample ) : Object . keys ( expected ) ) . length
166+ : 0 ;
163167
164- const replayCalls = getReplayCalls ( calls )
168+ const replayCalls = getReplayCalls ( calls ) ;
165169
166170 for ( const currentCall of replayCalls ) {
167171 result = checkCallForSentReplay . call ( this , currentCall [ 0 ] , expected ) ;
@@ -213,7 +217,7 @@ const toHaveLastSentReplay = function (
213217 expected ?: SentReplayExpected | { sample : SentReplayExpected ; inverse : boolean } ,
214218) {
215219 const { calls } = ( getCurrentHub ( ) . getClient ( ) ?. getTransport ( ) ?. send as MockTransport ) . mock ;
216- const replayCalls = getReplayCalls ( calls )
220+ const replayCalls = getReplayCalls ( calls ) ;
217221
218222 const lastCall = replayCalls [ calls . length - 1 ] ?. [ 0 ] ;
219223
0 commit comments