-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Description
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
reportersin your@nx/vitesttarget (like shown above) - Remove
reportersfrom the projects vite config - Run the vitest target
- Observe that the
reportersdefined 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.3Failure Logs
Package Manager Version
No response
Operating System
- macOS
- Linux
- Windows
- Other (Please specify)
Additional Information
Using reporter like the native vitest cli option makes the test run indefinitely