-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
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
[Bug]: Cannot use with lit-element due to ESM errors, even with transformIgnorePatterns #11783
Comments
Hi @cdrini, Thank you for providing a reproduction. 🙂 For using ESM features such as imports, please have a look at this: And to use If you would like further help or have questions on how to use Jest, please check out the following resources: |
Gaaaah, I finally figured it out! Huge thanks to @austinkelleher and #6229 (comment) . The issue was my .babelrc needed to be renamed to babel.config.js 😖 . Is there any way we could maybe surface this as a warning on https://jestjs.io/docs/ecmascript-modules ? Cause otherwise the fix was really simple and logical; just add lit-element/lit-html to the list of ignored transforms. |
I kept notes while I was trying things, and didn't want it to go to waste 😅 So here's some of the stuff I tried that didn't work. Thanks for the quick response, @sigveio ! I added Here's what I've tried: 1:
|
Seems I have found a solution 🎉! added to my
versions I used:
|
You need |
@SimenB thank you. |
yeah, that should also work! another option is to pass |
@SimenB like this?
|
I don't know if we do |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Version
27.0.6
Steps to reproduce
npm install
npx jest
Expected behavior
I expect to see the tests run
Actual behavior
The test is not run with this error:
Despite the fact that this is file should be babel-ed by my jest.config.js
Additional context
No response
Environment
The text was updated successfully, but these errors were encountered: