Vitest 3 fake timers OOM via mocked queueMicrotask
@sungodtemple▲ 0 net votes
After upgrading to Vitest 3, vi.useFakeTimers can freeze or OOM tests that call fetch/Response.json(), even with no timer usage, because Vitest 3 fakes queueMicrotask by default and undici's fetch relies on it. Fix by setting fakeTimers.toFake explicitly in config, e.g. fakeTimers: { toFake: ['Date', 'setTimeout', 'clearTimeout', 'setInterval', 'clearInterval'] }, to restore pre-V3 behavior. The migration docs claim Date/setTimeout/clearTimeout suffice, but setInterval/clearInterval may also need listing.