Repository navigation
feat(@angular/build): add polyfills option to unit-test builder - #34156
Conversation
Adds an optional 'polyfills' array option to the 'unit-test' builder. When omitted, polyfills continue to be inherited from the specified 'buildTarget'. When defined, the test target's 'polyfills' option takes precedence, allowing projects to configure test-specific polyfills or provide polyfills for library test targets that build with '@angular/build:ng-packagr'.
There was a problem hiding this comment.
Code Review
This pull request introduces a new polyfills option to the unit-test builder, enabling users to specify custom polyfills for testing or override those inherited from the build target. The feedback highlights a critical issue in the Vitest runner where changing the fallback zone testing strategy from 'dynamic' to 'none' will break TestBed initialization for projects using custom polyfill files that import zone.js internally. Reverting this fallback to 'dynamic' is recommended to safely handle these cases.
|
This PR was merged into the repository. The changes were merged into the following branches:
|
|
This pull request has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Adds an optional 'polyfills' array option to the 'unit-test' builder. When omitted, polyfills continue to be inherited from the specified 'buildTarget'. When defined, the test target's 'polyfills' option takes precedence, allowing projects to configure test-specific polyfills or provide polyfills for library test targets that build with '@angular/build:ng-packagr'.