Interface Saved

When entering a clock, the current state of the global is saved If another clock was already entered, it will revert back to that when exiting.

When we exit, if the monkey-patched global proxies get called, they will revert back to whatever the saved value was when they were patched. If that is another exited clock, it will proxy back to its original saved state, and so on, eventually hitting the original global state again if all clocks in the stack have been exited.

Hierarchy

  • Saved

Properties

Date: DateConstructor | typeof MockDate
clearImmediate: ((immediateId) => void)

Type declaration

    • (immediateId): void
    • Cancels an Immediate object created by setImmediate().

      Parameters

      • immediateId: undefined | Immediate

      Returns void

      Since

      v0.9.1

clearInterval: {
    (id): void;
    (intervalId): void;
}

Type declaration

    • (id): void
    • Parameters

      • id: undefined | number

      Returns void

    • (intervalId): void
    • Cancels a Timeout object created by setInterval().

      Parameters

      • intervalId: undefined | string | number | Timeout

      Returns void

      Since

      v0.0.1

clearTimeout: {
    (id): void;
    (timeoutId): void;
}

Type declaration

    • (id): void
    • Parameters

      • id: undefined | number

      Returns void

    • (timeoutId): void
    • Cancels a Timeout object created by setTimeout().

      Parameters

      • timeoutId: undefined | string | number | Timeout

      Returns void

      Since

      v0.0.1

performance: {
    now: (() => number);
}

Type declaration

  • now: (() => number)
      • (): number
      • Returns number

process: {
    hrtime: {
        bigint() => bigint;
        (t?): [number, number];
    };
}

Type declaration

  • hrtime: {
        bigint() => bigint;
        (t?): [number, number];
    }
      • (t?): [number, number]
      • Parameters

        • Optional t: [number, number]

        Returns [number, number]

    • bigint:function
setImmediate: SetImmediate
setInterval: SetInterval
setTimeout: SetTimeout

Generated using TypeDoc