You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
SyntaxError: Unexpected token 'with'
at Runtime.loadEsmModule (node_modules/jest-runtime/build/index.js:510:20)
Additional context
I'm using @babel/plugin-syntax-import-attributes with option deprecatedAssertSyntax so we can still use assert keyword (needed for my project). Babel is transforming it to with keyword.
If Jest config with transform: {} is added to your reproduction repo, the test is passing. Did I miss something? Do you need Babel for some reason?
Your project is written in ESM syntax and you have "type": "module" in package.json. So Jest is executing everything as ESM. There is no need to involve Babel, which is generally used to transform code into CJS. The transform: {} line simply tells to not transform anything. That would not work if you need Babel for some reason.
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.
Please note this issue tracker is not a help forum. We recommend using StackOverflow or our discord channel for questions.
Version
29.6.1
Steps to reproduce
npm install
andnpm test
Expected behavior
Runs test
Actual behavior
Returns the follwing error:
Additional context
I'm using
@babel/plugin-syntax-import-attributes
with optiondeprecatedAssertSyntax
so we can still useassert
keyword (needed for my project). Babel is transforming it towith
keyword.Environment
The text was updated successfully, but these errors were encountered: