Skip to content

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

Merged
clydin merged 1 commit intoangular:mainfrom
clydin:unit-test/bundle-setup-files
Feb 5, 2026
Merged

fix(@angular/build): bundle setup files in unit-test builder for Vitest#32428
clydin merged 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
@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 Feb 5, 2026
@pettersoft
Copy link

when can we expect this to be published to npm?

@clydin clydin merged commit 1f114a9 into angular:main Feb 5, 2026
35 checks passed
@clydin
Copy link
Member Author

clydin commented Feb 5, 2026

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

@clydin clydin deleted the unit-test/bundle-setup-files branch February 5, 2026 12:27
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: minor This PR is targeted for the next minor release

Projects

None yet

3 participants