-
Notifications
You must be signed in to change notification settings - Fork 2.6k
feat(angular): generate vitest unit test runner by default #33554
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
base: angular/v21
Are you sure you want to change the base?
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
View your CI Pipeline Execution ↗ for commit 986ea1e
☁️ Nx Cloud last updated this comment at |
c761da1 to
8859b53
Compare
8859b53 to
91be032
Compare
e090cd5 to
134b829
Compare
91be032 to
ed0f50f
Compare
ed0f50f to
eb87e04
Compare
eb87e04 to
1823761
Compare
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 is proposing a fix for your failed CI:
We added @angular/platform-browser-dynamic as a dependency when configuring Vitest for Angular 21+ projects. This fixes the Cypress component test failures that occurred because Cypress's Angular support requires @angular/platform-browser-dynamic/testing, which was not being installed in the new Vitest configuration path. This change mirrors the approach used in Jest configuration and ensures compatibility with all Angular testing tools.
We could not verify this fix.
diff --git a/packages/angular/src/generators/utils/add-vitest.ts b/packages/angular/src/generators/utils/add-vitest.ts
index 74f681b114..4e63d9f629 100644
--- a/packages/angular/src/generators/utils/add-vitest.ts
+++ b/packages/angular/src/generators/utils/add-vitest.ts
@@ -79,7 +79,11 @@ async function configureAngularUnitTestBuilderTarget(
addDependenciesToPackageJson(
tree,
- {},
+ {
+ // @angular/platform-browser-dynamic is required for Cypress component testing
+ // and other testing tools that depend on Angular's dynamic testing utilities
+ '@angular/platform-browser-dynamic': pkgVersions.angularVersion,
+ },
{
'@angular/build': angularDevkitVersion,
jsdom: pkgVersions.jsdomVersion,
Or Apply changes locally with:
npx nx-cloud apply-locally vLLI-cxL0
Apply fix locally with your editor ↗ View interactive diff ↗
🎓 Learn more about Self-Healing CI on nx.dev
1823761 to
4a44fef
Compare
4a44fef to
12332c5
Compare
20a5066 to
b4ce3fb
Compare
b4ce3fb to
986ea1e
Compare


@angular/build:unit-testbuilder when using theapplicationexecutor or the library'sng-packagrexecutors@nx/angular:unit-testexecutor to allow providing some extra options and whitelist the usage of relevant Nx executors