-
Notifications
You must be signed in to change notification settings - Fork 2.6k
fix(testing): remove --no-experimental-strip-types flag from @nx/jest/plugin + migrate to jest.config.cts if needed #33657
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
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
✅ Deploy Preview for nx-docs ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
View your CI Pipeline Execution ↗ for commit 6ae1a0a
☁️ Nx Cloud last updated this comment at |
…/plugin + migrate to jest.config.cts if needed On Node.js v24+, the `@nx/jest/plugin` sets `--no-experimental-strip-types` in NODE_OPTIONS which causes an error: "node: --no-experimental-strip-types is not allowed in NODE_OPTIONS". Additionally, `jest.config.ts` files using ESM syntax (`export default`, `import`) fail to load correctly under Node.js type-stripping when the project is configured for CommonJS. - Remove the NODE_OPTIONS manipulation that adds `--no-experimental-strip-types` - Add a migration (22.2.0-beta.2) that converts `jest.config.ts` files from ESM to CJS syntax for projects using `@nx/jest/plugin` - The migration only runs when `@nx/jest/plugin` is registered in `nx.json` - Projects with `type: module` are warned as they're incompatible with the plugin - Files using ESM-only features (import.meta, top-level await) are skipped with a warning for manual conversion Fixes NXC-3541 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nx Cloud has identified a flaky task in your failed CI:
🔂 Since the failure was identified as flaky, we reran your CI automatically.
🎓 Learn more about Self-Healing CI on nx.dev
| if ( | ||
| parent.kind === require('typescript').SyntaxKind.FunctionDeclaration || | ||
| parent.kind === require('typescript').SyntaxKind.FunctionExpression || | ||
| parent.kind === require('typescript').SyntaxKind.ArrowFunction || | ||
| parent.kind === require('typescript').SyntaxKind.MethodDeclaration | ||
| ) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: we could use ts.isFunctionLike(parent)
Current Behavior
On Node.js v24+, the
@nx/jest/pluginsets--no-experimental-strip-typesin NODE_OPTIONS which causes an error: "node: --no-experimental-strip-types is not allowed in NODE_OPTIONS".Additionally,
jest.config.tsfiles using ESM syntax (export default,import) fail to load correctly under Node.js type-stripping when the project is configured for CommonJS.Expected Behavior
--no-experimental-strip-typesjest.config.tsfiles from ESM to CJS syntax for projects using@nx/jest/plugin@nx/jest/pluginis registered innx.jsontype: moduleare warned as they're incompatible with the pluginDemo
https://www.loom.com/share/8a157a0b01d144ae8d6ae48b9b0cd0e4
Related Issue(s)
Closes NXC-3541