File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -221,15 +221,15 @@ test.each([true, false])(
221
221
jest . useFakeTimers ( { legacyFakeTimers } ) ;
222
222
223
223
const mockErrorFn = jest . fn ( ( ) => {
224
- // Wait 10 seconds so that check time is longer than interval
225
- blockThread ( 10 , legacyFakeTimers ) ;
224
+ // Wait 5 seconds so that check time is longer than interval
225
+ blockThread ( 5 , legacyFakeTimers ) ;
226
226
throw new Error ( 'test' ) ;
227
227
} ) ;
228
228
229
229
try {
230
230
await waitFor ( ( ) => mockErrorFn ( ) , {
231
- timeout : 200 ,
232
- interval : 5 ,
231
+ timeout : 6 ,
232
+ interval : 2 ,
233
233
} ) ;
234
234
} catch ( e ) {
235
235
// do nothing
@@ -238,7 +238,7 @@ test.each([true, false])(
238
238
// Verify that even though time to perform check is longer than interval
239
239
// test won't timeout until number of checks * interval >= timeout
240
240
// ie fake timers have been advanced by timeout when waitfor rejects
241
- expect ( mockErrorFn ) . toHaveBeenCalledTimes ( 41 ) ;
241
+ expect ( mockErrorFn ) . toHaveBeenCalledTimes ( 4 ) ;
242
242
}
243
243
) ;
244
244
You can’t perform that action at this time.
0 commit comments