Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • FakeTimerInstallOpts

Index

Properties

Optional advanceTimeDelta

advanceTimeDelta: number

Relevant only when using with shouldAdvanceTime: true. increment mocked time by advanceTimeDelta ms every advanceTimeDelta ms change in the real system time (default: 20)

Optional loopLimit

loopLimit: number

The maximum number of timers that will be run when calling runAll() (default: 1000)

Optional now

now: number | Date

Installs fake timers with the specified unix epoch (default: 0)

Optional shouldAdvanceTime

shouldAdvanceTime: boolean

Tells @sinonjs/fake-timers to increment mocked time automatically based on the real system time shift (e.g. the mocked time will be incremented by 20ms for every 20ms change in the real system time) (default: false)

Optional shouldClearNativeTimers

shouldClearNativeTimers: boolean

Tells FakeTimers to clear 'native' (i.e. not fake) timers by delegating to their respective handlers. These are not cleared by default, leading to potentially unexpected behavior if timers existed prior to installing FakeTimers. (default: false)

Optional toFake

toFake: FakeMethod[]

An array with names of global methods and APIs to fake. By default, @sinonjs/fake-timers does not replace nextTick() and queueMicrotask(). For instance, FakeTimers.install({ toFake: ['setTimeout', 'nextTick'] }) will fake only setTimeout() and nextTick()