Description
Command
test
Is this a regression?
- Yes, this behavior used to work in the previous version
The previous version in which this bug was not present was
No response
Description
The experimental @angular/build:unit-test
injects zone.js/testing
into the polyfills
of builder option but only for Vitest. In use runner: 'karma'
, there are no way to load zone.js/testing
for the environment.
I think this lines should be moved to the before branching runners. (if(runnerName === 'karma')
)
Minimal Reproduction
- Use
unit-test
builder forng test
- Use
fakeAsync
in tests - Run
ng test
Exception or Error
Error: zone-testing.js is needed for the fakeAsync() test helper but could not be found.
Please make sure that your environment includes zone.js/testing
at fakeAsync
Your Environment
Angular CLI: 20.0.3
Node: 22.16.0
Package Manager: pnpm 10.12.1
OS: darwin arm64
Angular: 20.0.4
... animations, common, compiler, compiler-cli, core, elements
... forms, platform-browser, platform-browser-dynamic, router
Package Version
------------------------------------------------------
@angular-devkit/architect 0.2000.3
@angular-devkit/core 20.0.3
@angular-devkit/schematics 20.0.3
@angular/build 20.0.3
@angular/cdk 20.0.3
@angular/cli 20.0.3
@schematics/angular 20.0.3
rxjs 7.8.2
typescript 5.8.3
zone.js 0.15.1
Anything else relevant?
No response