We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
We're currently jest-testing a wasm-pack built library running inside of a Next.js application.
wasm-pack
Build target is web. Jest version is 27.5.1.
web
27.5.1
The errors and solutions so far:
Cannot use 'import.meta' outside a module
babel-plugin-transform-import-meta
ReferenceError: TextEncoder is not defined
web-encoding
TypeError: Cannot read properties of undefined (reading '__wbindgen_malloc')
This seems to be caused by the deficiencies of jsdom.
jsdom
Is it possible to solve all of these issues in some simple way? Should I be trying to build nodejs in jest and web everywhere else?
nodejs
That does seem to work, but I haven't tried to find a way to achieve that automatically. I'll give that a go now.
Should be as simple as trying to use a web built lib in jest. Let me know if you have trouble.
Should just work in Jest.
Definitely doesn't just work in Jest.
The text was updated successfully, but these errors were encountered:
Sadly: jestjs/jest#11011
Sorry, something went wrong.
No branches or pull requests
Describe the Bug
We're currently jest-testing a
wasm-pack
built library running inside of a Next.js application.Build target is
web
.Jest version is
27.5.1
.The errors and solutions so far:
Cannot use 'import.meta' outside a module
babel-plugin-transform-import-meta
ReferenceError: TextEncoder is not defined
web-encoding
TypeError: Cannot read properties of undefined (reading '__wbindgen_malloc')
This seems to be caused by the deficiencies of
jsdom
.Is it possible to solve all of these issues in some simple way? Should I be trying to build
nodejs
in jest andweb
everywhere else?That does seem to work, but I haven't tried to find a way to achieve that automatically. I'll give that a go now.
Steps to Reproduce
Should be as simple as trying to use a
web
built lib in jest. Let me know if you have trouble.Expected Behavior
Should just work in Jest.
Actual Behavior
Definitely doesn't just work in Jest.
The text was updated successfully, but these errors were encountered: