Fake clock for tests. Frozen at start (epoch ms); only advance(ms) moves it forward, returning the new time. Keeps test outcomes repeatable.
start
advance(ms)
const clock = fixedClock(Date.UTC(2026, 6, 1));// ...subscribe against an economy wired with this clock...clock.advance(31 * 24 * 60 * 60 * 1000); // a month passes; the renewal is dueawait worker.sweep(); // the sweep reads the advanced time Copy
const clock = fixedClock(Date.UTC(2026, 6, 1));// ...subscribe against an economy wired with this clock...clock.advance(31 * 24 * 60 * 60 * 1000); // a month passes; the renewal is dueawait worker.sweep(); // the sweep reads the advanced time
Fake clock for tests. Frozen at
start(epoch ms); onlyadvance(ms)moves it forward, returning the new time. Keeps test outcomes repeatable.