Skip to content
masterclass Buddy

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.

Subscribe
  • jest.useRealTimers()
  • jest.runAllTimers()
  • jest.runOnlyPendingTimers()
  • jest.clearAllTimers()
  • jest.setSystemTime()

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