Skip to content
New issue

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

Jest failures #3066

Open
wilfredjonathanjames opened this issue Sep 5, 2022 · 1 comment
Open

Jest failures #3066

wilfredjonathanjames opened this issue Sep 5, 2022 · 1 comment
Labels

Comments

@wilfredjonathanjames
Copy link

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
  • ReferenceError: TextEncoder is not defined
  • TypeError: Cannot read properties of undefined (reading '__wbindgen_malloc')
    • No solution yet, but I'll keep you updated.

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 and web 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.

@gthb
Copy link
Contributor

gthb commented Sep 5, 2022

Sadly: jestjs/jest#11011

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants