fix(vitest): respect reporters from target options in vitest executor#34663
Merged
leosvelperez merged 1 commit intomasterfrom Mar 2, 2026
Merged
fix(vitest): respect reporters from target options in vitest executor#34663leosvelperez merged 1 commit intomasterfrom
leosvelperez merged 1 commit intomasterfrom
Conversation
✅ 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. |
Contributor
|
View your CI Pipeline Execution ↗ for commit a55fab5
☁️ Nx Cloud last updated this comment at |
Coly010
approved these changes
Mar 2, 2026
Target-level `reporter`/`reporters` options were being passed through to vitest as CLI args, causing vitest's resolveConfig to override the reporters array (which includes NxReporter), making the executor hang. Extract both forms from passThroughOptions and give them priority over config-file reporters. Set `reporter: []` to neutralize config's singular `reporter` from overriding NxReporter in vitest's resolveConfig step 2. Fallback chain: target reporter > target reporters > config reporter (singular) > config reporters (plural). Fixes #34495
FrozenPandaz
pushed a commit
that referenced
this pull request
Mar 4, 2026
…#34663) ## Current Behavior The vitest executor ignores `reporter`/`reporters` set in target options (project.json). Both forms leak through as passthrough CLI args, causing vitest's `resolveConfig` to override the `reporters` array (which includes NxReporter), making the executor hang indefinitely. Additionally, when the vite config uses `reporter` (singular), the config value always overrides the `reporters` array passed as inline options — again removing NxReporter. ## Expected Behavior Target-level `reporter`/`reporters` options take priority over config-file values. NxReporter is always preserved in the final reporters array regardless of configuration source. Priority chain: target `reporter` (singular) > target `reporters` (plural) > config `reporter` (singular) > config `reporters` (plural). ## Related Issue(s) Fixes #34495 (cherry picked from commit 2c802ba)
Contributor
|
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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Current Behavior
The vitest executor ignores
reporter/reportersset in target options (project.json). Both forms leak through as passthrough CLI args, causing vitest'sresolveConfigto override thereportersarray (which includes NxReporter), making the executor hang indefinitely.Additionally, when the vite config uses
reporter(singular), the config value always overrides thereportersarray passed as inline options — again removing NxReporter.Expected Behavior
Target-level
reporter/reportersoptions take priority over config-file values. NxReporter is always preserved in the final reporters array regardless of configuration source.Priority chain: target
reporter(singular) > targetreporters(plural) > configreporter(singular) > configreporters(plural).Related Issue(s)
Fixes #34495