MCPcopy
hub / github.com/date-fns/date-fns / fakeNow

Function fakeNow

pkgs/tz/src/date/tests.ts:12–15  ·  view source on GitHub ↗
(date = new Date(defaultDateStr))

Source from the content-addressed store, hash-verified

10
11 // NOTE: Make sure to add `{ concurrent: false }` to all tests that use it!
12 function fakeNow(date = new Date(defaultDateStr)) {
13 now = date;
14 vi.useFakeTimers({ now });
15 }
16
17 afterEach(() => vi.useRealTimers());
18

Callers 1

tests.tsFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected