Skip to content

fix(@angular/build): bundle setup files in unit-test builder for Vitest#32428

Open
clydin wants to merge 1 commit intoangular:mainfrom
clydin:unit-test/bundle-setup-files
Open

fix(@angular/build): bundle setup files in unit-test builder for Vitest#32428
clydin wants to merge 1 commit intoangular:mainfrom
clydin:unit-test/bundle-setup-files

Conversation

@clydin
Copy link
Member

@clydin clydin commented Feb 4, 2026

This change updates the Vitest runner in the unit-test builder to bundle 'setupFiles' through the application build pipeline, similar to test files. This ensures that setup files are processed with the same transformations and environment as the application code.

Note: Only setup files specified in the 'setupFiles' builder option are bundled. Setup files referenced solely within a custom Vitest configuration file (via 'runnerConfig') will not be bundled by the Angular CLI and will be processed directly by Vitest.

Closes #31732
Closes #31921

@clydin clydin added the target: minor This PR is targeted for the next minor release label Feb 4, 2026
@clydin clydin force-pushed the unit-test/bundle-setup-files branch 2 times, most recently from 8c5902a to 118830c Compare February 4, 2026 21:01
@clydin clydin marked this pull request as ready for review February 4, 2026 21:18
@clydin clydin added the action: review The PR is still awaiting reviews from at least one requested reviewer label Feb 4, 2026
@clydin clydin force-pushed the unit-test/bundle-setup-files branch from 118830c to 06b43fc Compare February 4, 2026 22:06
This change updates the Vitest runner in the unit-test builder to bundle 'setupFiles' through the application build pipeline, similar to test files. This ensures that setup files are processed with the same transformations and environment as the application code.

Note: Only setup files specified in the 'setupFiles' builder option are bundled. Setup files referenced solely within a custom Vitest configuration file (via 'runnerConfig') will not be bundled by the Angular CLI and will be processed directly by Vitest.
@clydin clydin force-pushed the unit-test/bundle-setup-files branch from 06b43fc to 123be34 Compare February 4, 2026 22:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

action: review The PR is still awaiting reviews from at least one requested reviewer area: @angular/build target: minor This PR is targeted for the next minor release

Projects

None yet

1 participant