@jest/fake-timers

  • Version 27.2.5
  • Published
  • 26.5 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 FakeTimers<TimerRef> {}

    constructor

    constructor({
    global,
    moduleMocker,
    timerConfig,
    config,
    maxLoops,
    }: {
    global: FakeTimersGlobal;
    moduleMocker: any;
    timerConfig: TimerConfig<TimerRef>;
    config: any;
    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 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 FakeTimers {}

                                  constructor

                                  constructor({
                                  global,
                                  config,
                                  maxLoops,
                                  }: {
                                  global: typeof globalThis;
                                  config: any;
                                  maxLoops?: number;
                                  });

                                    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 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: () => void;

                                                            method useRealTimers

                                                            useRealTimers: () => void;

                                                              Package Files (3)

                                                              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>