Skip to main content

Interface: FakeClockOptions

Defined in: packages/testing/src/clock.ts:27

Properties

autoAdvanceMs?

optional autoAdvanceMs?: number;

Defined in: packages/testing/src/clock.ts:41

Advance this many ms on every now() call. Default 0 — time only moves when a test moves it. Useful for asserting that code which stamps two timestamps in a row cannot produce identical values.


start?

optional start?: string | number;

Defined in: packages/testing/src/clock.ts:35

Where time starts: an ISO-8601 string or epoch millis.

The default is a fixed date, not Date.now(). A fixture that renders "2 days ago" must produce the same string on every machine and every run, and a default of "now" silently makes such a test depend on the calendar.