Skip to content
masterclass Buddy

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.

Subscribe
  • jest.useFakeTimers()
  • jest.advanceTimersByTimeAsync(msToRun)
  • jest.runOnlyPendingTimers()
  • jest.clearAllTimers()
  • jest.useRealTimers()

Source: Timer Mocks · Jest. Checked 2026-11-03.