- Notifications
You must be signed in to change notification settings - Fork26.7k
Description
Which @angular/* package(s) are the source of the bug?
zone.js
Is this a regression?
No
Description
Description / Descripción:
This StackBlitz demonstrates a minimal Angular 20 project withzone.js@0.15.x where unit tests cannot run due to the following error:
NG0908: In this configuration Angular requires Zone.js
zone-testing.js is needed for the fakeAsync() test helper but could not be found.
The project includes a minimal AppComponent and a basic test in app.component.spec.ts.
The test.ts file imports zone.js and zone.js/testing as recommended.
All dependencies are set to the latest Angular 20 and zone.js 0.15.x versions.
How to reproduce:
Clone this project locally or use the same setup in your environment.
Run npm install and then ng test.
Observe that all tests fail with the error above.
Note:
StackBlitz may not support running ng test directly, but this code matches the setup that fails locally.
Please provide a link to a minimal reproduction of the bug
stackblitz-comeditangular-9vvkqanb-filesrc2ftest-ts
Please provide the exception or error you saw
NG0908: In this configuration Angular requires Zone.jszone-testing.js is needed for the fakeAsync() test helper but could not be found.
Please provide the environment you discovered this bug in (runng version
)
Angular CLI: 20.3.4Node: 22.19.0Package Manager: npm 10.9.3OS: win32 x64 Angular: 20.3.3... common, compiler, compiler-cli, core, forms... platform-browser, platform-server, routerPackage Version------------------------------------@angular-devkit/architect 0.2003.4@angular-devkit/core 20.3.4@angular-devkit/schematics 20.3.4@angular/build 20.3.4@angular/cdk 20.2.7@angular/cli 20.3.4@angular/material 20.2.7@angular/ssr 20.3.4@schematics/angular 20.3.4rxjs 7.8.2typescript 5.9.3zone.js 0.15.1
Anything else?
No response