Jest · Function
jest.useFakeTimers
Use jest.useFakeTimers() to replace real timers with controllable fake timers. Advance or finish scheduled work without waiting for real time.
Last updated
Syntax
jest.useFakeTimers(fakeTimersConfig?)In-depth API docs are only for subscribers: parameters, examples, common mistakes and interview practice.
SubscribeRelated
jest.useRealTimers()jest.runAllTimers()jest.runOnlyPendingTimers()jest.clearAllTimers()jest.setSystemTime()