-
Notifications
You must be signed in to change notification settings - Fork 453
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]: setupFilesAfterEnv with a path to a TS file leads to the error "SyntaxError: Cannot use import statement outside a module" #4439
Comments
This happens to me too, but with actual TS test files with import statements, only on linux, not on windows |
This error started showing up for me too even though my jest config file does not make use of |
ahnpnl
added a commit
that referenced
this issue
Jul 10, 2024
2 tasks
Sorry for the issue, we will release hotfix quickly |
ahnpnl
added
🐛 Bug
Confirmed
Bug is confirmed
and removed
Bug Report
Needs Triage
labels
Jul 10, 2024
ahnpnl
added a commit
that referenced
this issue
Jul 10, 2024
ahnpnl
added a commit
that referenced
this issue
Jul 10, 2024
Awesome, thanks a lot for the quick fix! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Version
29.2.1
Steps to reproduce
yarn install
yarn test
ts-jest
version to29.2.0
yarn install
againyarn test
againExpected behavior
Before 29.2.1, I could run tests with a custom config using
setupFilesAfterEnv
pointing to a ts file.Actual behavior
Since 29.2.1, I get a
SyntaxError: Cannot use import statement outside a module
errorDebug log
Additional context
No response
Environment
The text was updated successfully, but these errors were encountered: