File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed
packages/browser/src/plugins/segmentio/__tests__ Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -140,7 +140,7 @@ describe('retryQueue', () => {
140140 let analytics : Analytics
141141 let segment : Plugin
142142 beforeEach ( async ( ) => {
143- jest . useRealTimers ( )
143+ jest . useFakeTimers ( { advanceTimers : true } )
144144 jest . resetAllMocks ( )
145145 jest . restoreAllMocks ( )
146146
@@ -150,9 +150,11 @@ describe('retryQueue', () => {
150150
151151 fetch . mockReturnValue ( createError ( { status : 500 } ) )
152152 } )
153+ afterEach ( ( ) => {
154+ jest . useRealTimers ( )
155+ } )
153156
154157 it ( 'Only attempts once if retryQueue is false' , async ( ) => {
155- jest . useFakeTimers ( { advanceTimers : true } )
156158 analytics = new Analytics (
157159 { writeKey : options . apiKey } ,
158160 { retryQueue : false }
@@ -170,7 +172,6 @@ describe('retryQueue', () => {
170172 } )
171173
172174 it ( 'Attempts multiple times if retryQueue is true' , async ( ) => {
173- jest . useFakeTimers ( { advanceTimers : true } )
174175 analytics = new Analytics (
175176 { writeKey : options . apiKey } ,
176177 { retryQueue : true }
You can’t perform that action at this time.
0 commit comments