fix(core): disallow Vitest & Angular unit test runner when bundler is not esbuild in cnw#34023
fix(core): disallow Vitest & Angular unit test runner when bundler is not esbuild in cnw#34023leosvelperez merged 1 commit intomasterfrom
Vitest & Angular unit test runner when bundler is not esbuild in cnw#34023Conversation
|
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 bdcaf99
☁️ Nx Cloud last updated this comment at |
There was a problem hiding this comment.
✅ The fix from Nx Cloud was applied
These changes fix the TypeScript compilation error by adding a type assertion after the .filter(Boolean) call. TypeScript cannot infer that filtering removes null values, so we explicitly cast the result to Array<{ name: string; message: string }> to satisfy the type requirements for the choices property.
We had verified this fix by re-running create-nx-workspace:test.
Suggested Fix changes
diff --git a/packages/create-nx-workspace/bin/create-nx-workspace.ts b/packages/create-nx-workspace/bin/create-nx-workspace.ts
index ef146994cd..a23f151ffa 100644
--- a/packages/create-nx-workspace/bin/create-nx-workspace.ts
+++ b/packages/create-nx-workspace/bin/create-nx-workspace.ts
@@ -1314,7 +1314,7 @@ async function determineAngularOptions(
name: 'none',
message: 'None',
},
- ].filter(Boolean),
+ ].filter(Boolean) as Array<{ name: string; message: string }>,
initial: 0,
},
])
This fix was applied by Leosvel Pérez Espinosa
🎓 Learn more about Self-Healing CI on nx.dev
AgentEnder
left a comment
There was a problem hiding this comment.
Left a suggestion, but its a nit. I think its a bit nicer, but realistically it doesn't matter. Up to you 🤷♂️
…is not `esbuild` in cnw
…is not `esbuild` in cnw (#34023) ## Current Behavior The `create-nx-workspace` incorrectly offers `Vitest & Angular` as a valid unit test runner choice when the bundler is something other than `esbuild`. ## Expected Behavior The `create-nx-workspace` should only offer `Vitest & Angular` as a valid unit test runner choice when the bundler is `esbuild`. ## Related Issue(s) Fixes #34014 (cherry picked from commit cc5d173)
|
This pull request has already been merged/closed. If you experience issues related to these changes, please open a new issue referencing this pull request. |
Current Behavior
The
create-nx-workspaceincorrectly offersVitest & Angularas a valid unit test runner choice when the bundler is something other thanesbuild.Expected Behavior
The
create-nx-workspaceshould only offerVitest & Angularas a valid unit test runner choice when the bundler isesbuild.Related Issue(s)
Fixes #34014