@@ -107,7 +107,7 @@ const createTestTransport = (...sendResults: MockResult<TransportMakeRequestResp
107107 } ;
108108} ;
109109
110- type StoreEvents = ( 'push' | 'unshift' | 'pop ' ) [ ] ;
110+ type StoreEvents = ( 'push' | 'unshift' | 'shift ' ) [ ] ;
111111
112112function createTestStore ( ...popResults : MockResult < Envelope | undefined > [ ] ) : {
113113 getCalls : ( ) => StoreEvents ;
@@ -130,8 +130,8 @@ function createTestStore(...popResults: MockResult<Envelope | undefined>[]): {
130130 calls . push ( 'unshift' ) ;
131131 }
132132 } ,
133- pop : async ( ) => {
134- calls . push ( 'pop ' ) ;
133+ shift : async ( ) => {
134+ calls . push ( 'shift ' ) ;
135135 const next = popResults . shift ( ) ;
136136
137137 if ( next instanceof Error ) {
@@ -182,7 +182,7 @@ describe('makeOfflineTransport', () => {
182182 await waitUntil ( ( ) => getCalls ( ) . length == 1 , 1_000 ) ;
183183
184184 // After a successful send, the store should be checked
185- expect ( getCalls ( ) ) . toEqual ( [ 'pop ' ] ) ;
185+ expect ( getCalls ( ) ) . toEqual ( [ 'shift ' ] ) ;
186186 } ) ;
187187
188188 it ( 'Envelopes are added after existing envelopes in the queue' , async ( ) => {
@@ -197,7 +197,7 @@ describe('makeOfflineTransport', () => {
197197
198198 expect ( getSendCount ( ) ) . toEqual ( 2 ) ;
199199 // After a successful send from the store, the store should be checked again to ensure it's empty
200- expect ( getCalls ( ) ) . toEqual ( [ 'pop ' , 'pop ' ] ) ;
200+ expect ( getCalls ( ) ) . toEqual ( [ 'shift ' , 'shift ' ] ) ;
201201 } ) ;
202202
203203 it ( 'Queues envelope if wrapped transport throws error' , async ( ) => {
@@ -259,7 +259,7 @@ describe('makeOfflineTransport', () => {
259259 await waitUntil ( ( ) => getCalls ( ) . length === 3 && getSendCount ( ) === 1 , START_DELAY * 2 ) ;
260260
261261 expect ( getSendCount ( ) ) . toEqual ( 1 ) ;
262- expect ( getCalls ( ) ) . toEqual ( [ 'push' , 'pop ' , 'pop ' ] ) ;
262+ expect ( getCalls ( ) ) . toEqual ( [ 'push' , 'shift ' , 'shift ' ] ) ;
263263 } ,
264264 START_DELAY + 2_000 ,
265265 ) ;
@@ -279,7 +279,7 @@ describe('makeOfflineTransport', () => {
279279 await waitUntil ( ( ) => getCalls ( ) . length === 3 && getSendCount ( ) === 2 , START_DELAY * 2 ) ;
280280
281281 expect ( getSendCount ( ) ) . toEqual ( 2 ) ;
282- expect ( getCalls ( ) ) . toEqual ( [ 'pop ' , 'pop ' , 'pop ' ] ) ;
282+ expect ( getCalls ( ) ) . toEqual ( [ 'shift ' , 'shift ' , 'shift ' ] ) ;
283283 } ,
284284 START_DELAY + 2_000 ,
285285 ) ;
@@ -299,7 +299,7 @@ describe('makeOfflineTransport', () => {
299299 await waitUntil ( ( ) => getCalls ( ) . length === 2 , START_DELAY * 2 ) ;
300300
301301 expect ( getSendCount ( ) ) . toEqual ( 0 ) ;
302- expect ( getCalls ( ) ) . toEqual ( [ 'pop ' , 'unshift' ] ) ;
302+ expect ( getCalls ( ) ) . toEqual ( [ 'shift ' , 'unshift' ] ) ;
303303 } ,
304304 START_DELAY + 2_000 ,
305305 ) ;
@@ -361,12 +361,12 @@ describe('makeOfflineTransport', () => {
361361 // We're sending a replay envelope and they always get queued
362362 'push' ,
363363 // The first envelope popped out fails to send so it gets added to the front of the queue
364- 'pop ' ,
364+ 'shift ' ,
365365 'unshift' ,
366366 // The rest of the attempts succeed
367- 'pop ' ,
368- 'pop ' ,
369- 'pop ' ,
367+ 'shift ' ,
368+ 'shift ' ,
369+ 'shift ' ,
370370 ] ) ;
371371
372372 const envelopes = getSentEnvelopes ( ) . map ( parseEnvelope ) ;
@@ -416,7 +416,7 @@ describe('makeOfflineTransport', () => {
416416
417417 expect ( getSendCount ( ) ) . toEqual ( 2 ) ;
418418 expect ( queuedCount ) . toEqual ( 0 ) ;
419- expect ( getCalls ( ) ) . toEqual ( [ 'pop ' , 'pop ' ] ) ;
419+ expect ( getCalls ( ) ) . toEqual ( [ 'shift ' , 'shift ' ] ) ;
420420 } ,
421421 START_DELAY * 3 ,
422422 ) ;
0 commit comments