@jest/fake-timers

  • Version 29.3.1
  • Published
  • 25.4 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

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 advanceTimersToNextTimer

                                        advanceTimersToNextTimer: (steps?: number) => 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 runOnlyPendingTimers

                                                          runOnlyPendingTimers: () => 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 onejsDocs.io badgeto 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>