Skip to content

fix(@angular/build): warn when vitest watch config conflicts with builder#32806

Merged
clydin merged 1 commit intoangular:mainfrom
clydin:vitest/watch-config-warning
Mar 20, 2026
Merged

fix(@angular/build): warn when vitest watch config conflicts with builder#32806
clydin merged 1 commit intoangular:mainfrom
clydin:vitest/watch-config-warning

Conversation

@clydin
Copy link
Member

@clydin clydin commented Mar 19, 2026

Added a warning in the angular:vitest-configuration plugin to alert users if the watch option specified in their vitest.config.ts differs from the Angular CLI builder's --watch option. Because the Angular CLI's build system and file watcher drives the execution, the Vitest-specific watch option is overridden and has no effect.

…lder

Added a warning in the `angular:vitest-configuration` plugin to alert users if
the `watch` option specified in their `vitest.config.ts` differs from the
Angular CLI builder's `--watch` option. Because the Angular CLI's build system
and file watcher drives the execution, the Vitest-specific `watch` option is
overridden and has no effect.
@clydin clydin added the target: patch This PR is targeted for the next patch release label Mar 19, 2026
Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a helpful warning for users when their vitest.config.ts watch setting conflicts with the Angular CLI's --watch option. The implementation correctly identifies the conflict, issues a warning, and overrides the configuration to prevent unexpected behavior. A corresponding test case has been added to ensure this functionality works as expected. I have one minor suggestion to improve the code's readability.

@clydin clydin requested a review from alan-agius4 March 20, 2026 00:38
@clydin clydin added the action: review The PR is still awaiting reviews from at least one requested reviewer label Mar 20, 2026
@alan-agius4 alan-agius4 added action: merge The PR is ready for merge by the caretaker and removed action: review The PR is still awaiting reviews from at least one requested reviewer labels Mar 20, 2026
@alan-agius4 alan-agius4 linked an issue Mar 20, 2026 that may be closed by this pull request
1 task
@clydin clydin merged commit ec10eb3 into angular:main Mar 20, 2026
39 checks passed
@clydin
Copy link
Member Author

clydin commented Mar 20, 2026

This PR was merged into the repository. The changes were merged into the following branches:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

action: merge The PR is ready for merge by the caretaker area: @angular/build target: patch This PR is targeted for the next patch release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

angular.json overrides watch and coverage options from vitest.config.ts

2 participants