Description
src/timeMachine.ts provides a clock-override utility used in time-sensitive tests, but there are no tests covering boundary cases: advancing time past midnight, advancing by zero milliseconds, and restoring the real clock after an override.
Acceptance Criteria
Context
- Target file:
src/timeMachine.ts
- Tests should live in
src/__tests__/timeMachine.test.ts
Description
src/timeMachine.tsprovides a clock-override utility used in time-sensitive tests, but there are no tests covering boundary cases: advancing time past midnight, advancing by zero milliseconds, and restoring the real clock after an override.Acceptance Criteria
restore(),Date.now()returns a value within 50 ms of the real wall clockContext
src/timeMachine.tssrc/__tests__/timeMachine.test.ts