Closed remarkablemark closed 1 year ago
If the web steam API is not available, then you should able to circumvent this issue by importing this module before running the tests: https://www.npmjs.com/package/web-streams-polyfill
Thanks! I ended up creating a module mock for the package:
mkdir -p __mocks__/@zip.js/
echo "module.exports = {};" > __mocks__/@zip.js/zip.js.js
I'm using
zip.js
in my frontend project and I'm trying to write Jest tests but they're failing with:I'm using
jsdom
for my test environment.Is the best way to resolve this is to mock the node module? I have seen other projects provide a mock file for Jest.