philomena/assets/test/mock-date-now.ts
David Joseph Guzsik 2417f40d37
Switch jest unit tests to vitest (#243)
* Switch jest unit tests to vitest

* Cleanup vite config after debugging
2024-04-30 20:44:26 +02:00

9 lines
192 B
TypeScript

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