philomena/assets/test/mock-date-now.ts

10 lines
192 B
TypeScript
Raw Normal View History

export function mockDateNow(initialDateNow: number): void {
beforeAll(() => {
vi.useFakeTimers().setSystemTime(initialDateNow);
});
afterAll(() => {
vi.useRealTimers();
});
}