@@ -17,7 +17,7 @@ import {
17
17
parseEnvelope ,
18
18
} from '@sentry/utils' ;
19
19
20
- import { describe , expect , it } from 'vitest' ;
20
+ import { describe , expect , it , vi } from 'vitest' ;
21
21
import { createTransport } from '../../../src' ;
22
22
import type { CreateOfflineStore , OfflineTransportOptions } from '../../../src/transports/offline' ;
23
23
import { START_DELAY , makeOfflineTransport } from '../../../src/transports/offline' ;
@@ -162,7 +162,9 @@ function waitUntil(fn: () => boolean, timeout: number): Promise<void> {
162
162
}
163
163
164
164
describe ( 'makeOfflineTransport' , ( ) => {
165
- it ( 'Sends envelope and checks the store for further envelopes' , async ( ) => {
165
+ vi . useFakeTimers ( ) ;
166
+
167
+ it ( 'sends envelope and checks the store for further envelopes' , async ( ) => {
166
168
const { getCalls, store } = createTestStore ( ) ;
167
169
const { getSendCount, baseTransport } = createTestTransport ( { statusCode : 200 } ) ;
168
170
let queuedCount = 0 ;
@@ -174,6 +176,9 @@ describe('makeOfflineTransport', () => {
174
176
return true ;
175
177
} ,
176
178
} ) ;
179
+
180
+ vi . runAllTimersAsync ( ) ;
181
+
177
182
const result = await transport . send ( ERROR_ENVELOPE ) ;
178
183
179
184
expect ( result ) . toEqual ( { statusCode : 200 } ) ;
@@ -411,7 +416,7 @@ describe('makeOfflineTransport', () => {
411
416
START_DELAY + 2_000 ,
412
417
) ;
413
418
414
- it . skip (
419
+ it (
415
420
'Follows the Retry-After header' ,
416
421
async ( ) => {
417
422
const { getCalls, store } = createTestStore ( ERROR_ENVELOPE ) ;
0 commit comments