time-fast-forward
Version:
Fake the system time (Date, hrtime) in your tests, without freezing it (unlike in many other libraries). Freeze only when you need.
11 lines (10 loc) • 466 B
TypeScript
export declare const fakeDate: () => void;
export declare const restoreDate: () => void;
export declare const setTimeShift: (shift: number) => number;
export declare const getCurrentTimeShift: () => number;
export declare class FakeDate extends Date {
static now(): number;
constructor();
constructor(value: number | string);
constructor(year: number, month: number, date?: number, hours?: number, minutes?: number, seconds?: number, ms?: number);
}