Current Behavior
Specifying reporters in the target options is not taken into account even when no reporters are specified in vite config.
This change came from #34113
More specifically this line: 1161c08#diff-e6200efd60b8225d7f6e50c241e422403d361d17e0828bf7cbec13797a507b91R100
it overrides passThroughOptions.reporters and only takes what's in the vite config file
Example nx target config:
"@nx/vitest:test": {
...
"options": {
...
"reporters": ["junit"]
},
}
Expected Behavior
The @nx/vitest executor should respect the reporters set in the target options, especially if none are set in the vite config
Current implementation
In https://github.com/nrwl/nx/blob/master/packages/vitest/src/executors/test/lib/utils.ts#L100 we have:
reporters: resolved?.config?.['test']?.reporters
Should be:
reporters: resolved?.config?.['test']?.reporters || passThroughOptions.reporters
GitHub Repo
No response
Steps to Reproduce
- Define
reporters in your @nx/vitest target (like shown above)
- Remove
reporters from the projects vite config
- Run the vitest target
- Observe that the
reporters defined are completely ignored.
Nx Report
Node : 22.20.0
OS : darwin-arm64
Native Target : aarch64-macos
pnpm : 10.16.1
daemon : Available
nx : 22.5.1
@nx/js : 22.5.1
@nx/eslint : 22.5.1
@nx/workspace : 22.5.1
@nx/devkit : 22.5.1
@nx/eslint-plugin : 22.5.1
@nx/node : 22.5.1
@nx/playwright : 22.5.1
@nx/plugin : 22.5.1
@nx/react : 22.5.1
@nx/rollup : 22.5.1
@nx/storybook : 22.5.1
@nx/vite : 22.5.1
@nx/vitest : 22.3.3
@nx/web : 22.5.1
typescript : 5.8.3
Failure Logs
Package Manager Version
No response
Operating System
Additional Information
Using reporter like the native vitest cli option makes the test run indefinitely
Current Behavior
Specifying
reportersin the target options is not taken into account even when noreportersare specified in vite config.This change came from #34113
More specifically this line: 1161c08#diff-e6200efd60b8225d7f6e50c241e422403d361d17e0828bf7cbec13797a507b91R100
it overrides
passThroughOptions.reportersand only takes what's in the vite config fileExample nx target config:
Expected Behavior
The
@nx/vitestexecutor should respect thereportersset in the target options, especially if none are set in the vite configCurrent implementation
In https://github.com/nrwl/nx/blob/master/packages/vitest/src/executors/test/lib/utils.ts#L100 we have:
reporters: resolved?.config?.['test']?.reportersShould be:
reporters: resolved?.config?.['test']?.reporters || passThroughOptions.reportersGitHub Repo
No response
Steps to Reproduce
reportersin your@nx/vitesttarget (like shown above)reportersfrom the projects vite configreportersdefined are completely ignored.Nx Report
Failure Logs
Package Manager Version
No response
Operating System
Additional Information
Using
reporterlike the native vitest cli option makes the test run indefinitely