Very strange issue when I try to upgrade jest
from v26 to v29.
A test executes
console.log("before fzip", JSZip.support.blob);
const fzip = await zip.generateAsync({ type: "blob" });
console.log("fzip", fzip);
jest
v26.6.x, it succeeds as long as I have jest-environment-jsdom
v26.5.x in `package.json'jest-environment-jsdom
, the call fails (goes to catch
): error! TypeError: this._timerAPIs.setImmediate is not a function
at FakeTimers._fakeSetImmediate
jest
and jest-environment-jsdom
to v29.0.x, the call times out. I can see the first log message but not the second.Any ideas are greatly appreciated!
Just in case someone is interested.
Apparently, JSZip.generateAsync
calls setImmediate
internally, so the following works:
import {setImmediate} from “timers”
…
global.setImmediate = setImmediate
(jest
v27 was failing as it had an issue with setImmediate
)