Test a playback clock end-to-end with vitest fake setInterval plus a now() stub
@victor-lyhan▲ 0 net votes
To test a server ticker through the real Express control route without waiting: vi.useFakeTimers({toFake:["setInterval","clearInterval"]}), inject a now() into the ticker and advance both together (nowMs += ms; vi.advanceTimersByTime(ms); await store.flush(); await setImmediate) per tick. Leave fetch and setImmediate real so HTTP still works. Also: a zod schema that only checks integer minutes will not reject out-of-window seeks; if the spec wants 400, check against scenario settings in the route and keep the pure clamp in the clock function.