Conversation
…tTestRunner option ## Current Behavior - @nx/next:application only allows jest/none while @nx/next:library allows vitest - @nx/react host/remote/federate-module schema enums block vitest even though the underlying application generator supports it - create-nx-workspace hides the vitest choice for Next.js presets and the node stack, though node/express/nest generators accept it ## Expected Behavior - @nx/next:application accepts --unitTestRunner=vitest (standalone vitest.config.mts, specs/ include, spec types in tsconfig.json) - @nx/react host/remote/federate-module accept vitest and pass it through - create-nx-workspace prompts include vitest for Next.js and node stacks; react-native/expo still exclude it (jest-only upstream) - @nx/vite createOrEditViteConfig accepts testInclude for projects whose specs live outside src/ ## Related Issue(s) Fixes NXC-4780
✅ Deploy Preview for nx-docs ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
✅ Deploy Preview for nx-dev ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
View your CI Pipeline Execution ↗ for commit 5362548
☁️ Nx Cloud last updated this comment at |
…t vitest apps
## Current Behavior
Generated vitest.config.mts imports @nx/vite/plugins/* but @nx/vite never lands in the user's package.json (skipViteConfig bypasses the generator that adds it), so nx test fails at config load in non-ts-solution workspaces. Specs colocated under src/ are silently skipped.
## Expected Behavior
@nx/vite added as devDependency when the config references it. Vitest include covers {src,specs}.
## Related Issue(s)
NXC-4780
…or next apps ## Current Behavior Next vitest wiring goes through @nx/vite createOrEditViteConfig, and the generated config pulls in the deprecated nxViteTsPaths/nxCopyAssetsPlugin helpers (plus an @nx/vite dep). ## Expected Behavior @nx/vitest exports its own createOrEditViteConfig (testInclude added there, @nx/vite untouched). Next configs skip the deprecated helper plugins via skipNxPlugins, so no @nx/vite dep is generated or needed. ## Related Issue(s) NXC-4780
## Current Behavior No e2e exercises the next generators with vitest. ## Expected Behavior e2e-next covers app generation with vitest (generated specs/ test plus a colocated src/ spec) and lib generation with vitest. ## Related Issue(s) NXC-4780
…ocated spec in e2e
## Current Behavior
Vitest include misses colocated specs in root app/ or pages/ when --no-src is used. The e2e colocated-spec assertion passes even if colocation regresses.
## Expected Behavior
Include covers {src,app,pages,specs}. e2e asserts both spec files actually ran.
## Related Issue(s)
NXC-4780
## Current Behavior Comment restates why an ignored dependency is listed. ## Expected Behavior List entry only, like its siblings. ## Related Issue(s) NXC-4780
## Current Behavior A spec importing via the @/* alias fails to resolve under vitest: the alias lives in the app tsconfig.json, tsconfig.spec.json extends tsconfig.base.json without it, and neither vite-tsconfig-paths nor vite 8's native resolve.tsconfigPaths applies on vitest's transform path. ## Expected Behavior Generated config mirrors the app tsconfig paths as explicit resolve.alias entries (new resolveAlias option on @nx/vitest createOrEditViteConfig); tsconfig.spec.json gets the paths copied for typechecking. testInclude values escape single quotes. e2e app test imports via @/ to prove it. Assertion-narrating comments dropped. ## Related Issue(s) NXC-4780
## Current Behavior No coverage for @/* -> ./* (--no-src) alias derivation. ## Expected Behavior Unit test pins the emitted alias and tsconfig.spec.json paths for --no-src apps. Runtime resolution with the trailing-slash root verified against a live workspace. ## Related Issue(s) NXC-4780
…s support ## Current Behavior Legacy workspaces cannot resolve root tsconfig aliases in next vitest specs. Generated specs/ sits outside tsconfig.spec.json include in ts-solution setups. testInclude backslashes and alias apostrophes can corrupt emitted configs; URL .pathname percent-encodes spaces. resolveAlias silently dropped for existing configs. ## Expected Behavior Root tsconfig paths mirrored as offset aliases in non-ts-solution workspaces (wildcard and exact entries). tsconfig.spec.json include covers specs/. Literals fully escaped (backslash + quote); aliases emitted via join(import.meta.dirname, ...). Existing-config path warns when resolveAlias cannot be applied. ## Related Issue(s) NXC-4780
There was a problem hiding this comment.
Important
At least one additional CI pipeline execution has run since the conclusion below was written and it may no longer be applicable.
Nx Cloud is proposing a fix for your failed CI:
We updated the create-nx-workspace unit test to align with the PR's intentional change: the node stack now offers vitest as a valid unit test runner, so asserting it is excluded was incorrect. Clearing excluded for the node stack entry removes it from the "should not offer excluded runner" assertion, fixing the test failure without reverting any feature work.
Warning
❌ We could not verify this fix.
diff --git a/packages/create-nx-workspace/bin/create-nx-workspace.spec.ts b/packages/create-nx-workspace/bin/create-nx-workspace.spec.ts
index 0a9a3592..3fed541c 100644
--- a/packages/create-nx-workspace/bin/create-nx-workspace.spec.ts
+++ b/packages/create-nx-workspace/bin/create-nx-workspace.spec.ts
@@ -547,7 +547,7 @@ describe('determineUnitTestRunner', () => {
workspaceType: 'integrated',
},
expected: 'jest',
- excluded: 'vitest',
+ excluded: '',
},
};
Or Apply changes locally with:
npx nx-cloud apply-locally vwfu-OzrC
Apply fix locally with your editor ↗ View interactive diff ↗
🎓 Learn more about Self-Healing CI on nx.dev
…ases ## Current Behavior --js apps leave the generated spec outside typed projects (no allowJs). Root tsconfig paths with a non-root baseUrl map to the wrong directory. CR/LF in emitted literals breaks the config. resolveAlias leaks an unused join import into existing configs. ## Expected Behavior allowJs set in tsconfig.spec.json for --js apps. Root path mappings resolve against baseUrl. Line terminators escaped. join import only emitted for new config files. ## Related Issue(s) NXC-4780
…ock node vitest fixture ## Current Behavior createOrEditViteConfig exported from @nx/vitest/generators without an API contract. New CNW prompt spec from master still expects node to exclude vitest. ## Expected Behavior Helper moves to @nx/vitest/internal (first-party surface). Node stack fixture no longer expects an exclusion. ## Related Issue(s) NXC-4780
Current Behavior
@nx/next:applicationonly allows jest/none while@nx/next:libraryallows vitest.@nx/reacthost/remote/federate-module schema enums block vitest even though the underlying application generator supports it. create-nx-workspace hides the vitest choice for Next.js presets and the node stack.Expected Behavior
vitest is selectable everywhere the underlying generator supports it:
@nx/next:application(standalone vitest.config.mts, specs/ include, spec types in tsconfig.json),@nx/reacthost/remote/federate-module, and the CNW prompts for Next.js and node stacks. react-native/expo (jest-only upstream), angular MF (vitest-angular needs esbuild), and nuxt/vue (vitest-only) are intentionally unchanged.Related Issue(s)
NXC-4780
View Polygraph session ↗