-
-
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
Unexpected token import es6 class #6404
Comments
This is not a bug. You need to configure Babel properly to use ES6 modules with Jest. Please read our documentation, or have a better search on this issue tracker or Stack Overflow. |
Seems like there's a possible bug here. Example 1 - Trying to import a non-existent path
This fails because it can't find Example 2 - Trying to import a from the correct path
Fails on the first import with I would expect an improper babel configuration would result in The |
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. |
🐛 Bug Report
When I run JEST, the execution failed and show the message:
To Reproduce
Execute the command:
λ npm run test
Expected behavior
Executing all test without any error.
Code
File packages.json
File: calculator.js
File: calculator.spec.js
Run
npx envinfo --preset jest
The text was updated successfully, but these errors were encountered: