-
Notifications
You must be signed in to change notification settings - Fork 11.9k
Open
Labels
angular/build:unit-testarea: @angular/buildfreq1: lowOnly reported by a handful of users who observe it rarelyOnly reported by a handful of users who observe it rarelyseverity5: regressiontype: bug/fix
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
21.0.0-next.8
Description
When running tests with the include option such as:
ng test --browsers ChromiumHeadless --include="src/app/app.spec.ts"
the unit test runner fails with:
Error: Need to call TestBed.initTestEnvironment() first
The unit test passes if all tests are run (i.e. without the include option).
Minimal Reproduction
Run tests with the include option:
ng test --browsers ChromiumHeadless --include="src/app/app.spec.ts"
Exception or Error
Error: Need to call TestBed.initTestEnvironment() first
Your Environment
Angular CLI : 21.0.0-rc.0
Angular : 21.0.0-rc.0
Node.js : 22.18.0
Package Manager : npm 10.9.3
Operating System : win32 x64
┌───────────────────────────┬───────────────────┬───────────────────┐
│ Package │ Installed Version │ Requested Version │
├───────────────────────────┼───────────────────┼───────────────────┤
│ @angular/build │ 21.0.0-rc.0 │ ^21.0.0-next.10 │
│ @angular/cdk │ 21.0.0-rc.0 │ ^21.0.0-next.10 │
│ @angular/cli │ 21.0.0-rc.0 │ ^21.0.0-next.10 │
│ @angular/common │ 21.0.0-rc.0 │ ^21.0.0-next.10 │
│ @angular/compiler │ 21.0.0-rc.0 │ ^21.0.0-next.10 │
│ @angular/compiler-cli │ 21.0.0-rc.0 │ ^21.0.0-next.10 │
│ @angular/core │ 21.0.0-rc.0 │ ^21.0.0-next.10 │
│ @angular/forms │ 21.0.0-rc.0 │ ^21.0.0-next.10 │
│ @angular/language-service │ 21.0.0-rc.0 │ ^21.0.0-next.10 │
│ @angular/platform-browser │ 21.0.0-rc.0 │ ^21.0.0-next.10 │
│ @angular/router │ 21.0.0-rc.0 │ ^21.0.0-next.10 │
│ rxjs │ 7.8.2 │ ~7.8.0 │
│ typescript │ 5.9.3 │ ~5.9.2 │
└───────────────────────────┴───────────────────┴───────────────────┘
Anything else relevant?
No response
Metadata
Metadata
Assignees
Labels
angular/build:unit-testarea: @angular/buildfreq1: lowOnly reported by a handful of users who observe it rarelyOnly reported by a handful of users who observe it rarelyseverity5: regressiontype: bug/fix