@jest/fake-timers
- Version 29.7.0
- Published
- 26.3 kB
- 6 dependencies
- MIT license
Install
npm i @jest/fake-timers
yarn add @jest/fake-timers
pnpm add @jest/fake-timers
Overview
Overview not available.
Index
Classes
ModernFakeTimers
- advanceTimersByTime()
- advanceTimersByTimeAsync()
- advanceTimersToNextTimer()
- advanceTimersToNextTimerAsync()
- clearAllTimers()
- dispose()
- getRealSystemTime()
- getTimerCount()
- now()
- reset()
- runAllTicks()
- runAllTimers()
- runAllTimersAsync()
- runOnlyPendingTimers()
- runOnlyPendingTimersAsync()
- setSystemTime()
- useFakeTimers()
- useRealTimers()
Classes
class LegacyFakeTimers
class LegacyFakeTimers<TimerRef = unknown> {}
constructor
constructor({ global, moduleMocker, timerConfig, config, maxLoops,}: { global: typeof globalThis; moduleMocker: ModuleMocker; timerConfig: TimerConfig<TimerRef>; config: StackTraceConfig; maxLoops?: number;});
method advanceTimersByTime
advanceTimersByTime: (msToRun: number) => void;
method advanceTimersToNextTimer
advanceTimersToNextTimer: (steps?: number) => void;
method clearAllTimers
clearAllTimers: () => void;
method dispose
dispose: () => void;
method getTimerCount
getTimerCount: () => number;
method now
now: () => number;
method reset
reset: () => void;
method runAllImmediates
runAllImmediates: () => void;
method runAllTicks
runAllTicks: () => void;
method runAllTimers
runAllTimers: () => void;
method runOnlyPendingTimers
runOnlyPendingTimers: () => void;
method runWithRealTimers
runWithRealTimers: (cb: Callback) => void;
method useFakeTimers
useFakeTimers: () => void;
method useRealTimers
useRealTimers: () => void;
class ModernFakeTimers
class ModernFakeTimers {}
constructor
constructor({ global, config,}: { global: typeof globalThis; config: Config.ProjectConfig;});
method advanceTimersByTime
advanceTimersByTime: (msToRun: number) => void;
method advanceTimersByTimeAsync
advanceTimersByTimeAsync: (msToRun: number) => Promise<void>;
method advanceTimersToNextTimer
advanceTimersToNextTimer: (steps?: number) => void;
method advanceTimersToNextTimerAsync
advanceTimersToNextTimerAsync: (steps?: number) => Promise<void>;
method clearAllTimers
clearAllTimers: () => void;
method dispose
dispose: () => void;
method getRealSystemTime
getRealSystemTime: () => number;
method getTimerCount
getTimerCount: () => number;
method now
now: () => number;
method reset
reset: () => void;
method runAllTicks
runAllTicks: () => void;
method runAllTimers
runAllTimers: () => void;
method runAllTimersAsync
runAllTimersAsync: () => Promise<void>;
method runOnlyPendingTimers
runOnlyPendingTimers: () => void;
method runOnlyPendingTimersAsync
runOnlyPendingTimersAsync: () => Promise<void>;
method setSystemTime
setSystemTime: (now?: number | Date) => void;
method useFakeTimers
useFakeTimers: (fakeTimersConfig?: Config.FakeTimersConfig) => void;
method useRealTimers
useRealTimers: () => void;
Package Files (1)
Dependencies (6)
Dev Dependencies (2)
Peer Dependencies (0)
No peer dependencies.
Badge
To add a badge like this oneto your package's README, use the codes available below.
You may also use Shields.io to create a custom badge linking to https://www.jsdocs.io/package/@jest/fake-timers
.
- Markdown[![jsDocs.io](https://img.shields.io/badge/jsDocs.io-reference-blue)](https://www.jsdocs.io/package/@jest/fake-timers)
- HTML<a href="https://www.jsdocs.io/package/@jest/fake-timers"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>
- Updated .
Package analyzed in 1267 ms. - Missing or incorrect documentation? Open an issue for this package.