Jest · Method
jest.advanceTimersByTime
Advances Jest's fake clock by a chosen number of milliseconds. It runs eligible pending macro-tasks, including timers created during that interval.
Last updated
Syntax
jest.advanceTimersByTime(msToRun)In-depth API docs are only for subscribers: parameters, examples, common mistakes and interview practice.
SubscribeRelated
jest.useFakeTimers()jest.advanceTimersByTimeAsync(msToRun)jest.runOnlyPendingTimers()jest.clearAllTimers()jest.useRealTimers()