Skip to content

refactor(@angular/build): improve Vitest configuration merging#31756

Merged
clydin merged 1 commit intoangular:mainfrom
clydin:unit-test/improve-vitest-config-merge
Nov 12, 2025
Merged

refactor(@angular/build): improve Vitest configuration merging#31756
clydin merged 1 commit intoangular:mainfrom
clydin:unit-test/improve-vitest-config-merge

Conversation

@clydin
Copy link
Member

@clydin clydin commented Nov 11, 2025

This commit refactors the Vitest configuration handling within the unit test builder to more reliably merge the CLI-generated configuration with a user's vitest-base.config.ts file.

The new implementation uses Vitest's mergeConfig utility to create a layered configuration, ensuring that essential CLI settings (such as test entry points and in-memory file providers) are preserved while still allowing users to customize other options. This prevents user configurations from inadvertently overriding critical builder settings, leading to a more stable and predictable testing experience.

@clydin clydin added the target: rc This PR is targeted for the next release-candidate label Nov 11, 2025
@clydin clydin force-pushed the unit-test/improve-vitest-config-merge branch 5 times, most recently from 684345a to be58719 Compare November 11, 2025 21:45
@clydin clydin added action: review The PR is still awaiting reviews from at least one requested reviewer and removed action: review The PR is still awaiting reviews from at least one requested reviewer labels Nov 11, 2025
@clydin clydin marked this pull request as draft November 11, 2025 22:19
@clydin clydin marked this pull request as ready for review November 11, 2025 22:27
This commit refactors the Vitest configuration handling within the unit test builder to more reliably merge the CLI-generated configuration with a user's `vitest-base.config.ts` file.

The new implementation uses Vitest's `mergeConfig` utility to create a layered configuration, ensuring that essential CLI settings (such as test entry points and in-memory file providers) are preserved while still allowing users to customize other options. This prevents user configurations from inadvertently overriding critical builder settings, leading to a more stable and predictable testing experience.
@clydin clydin force-pushed the unit-test/improve-vitest-config-merge branch from be58719 to a9d6ff7 Compare November 11, 2025 22:31
@clydin clydin added the action: review The PR is still awaiting reviews from at least one requested reviewer label Nov 11, 2025
@clydin clydin requested a review from alan-agius4 November 12, 2025 14:52
@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 Nov 12, 2025
@clydin clydin merged commit 23ff4e9 into angular:main Nov 12, 2025
33 checks passed
@clydin
Copy link
Member Author

clydin commented Nov 12, 2025

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

@clydin clydin deleted the unit-test/improve-vitest-config-merge branch November 12, 2025 15:53
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Dec 13, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants