-
Notifications
You must be signed in to change notification settings - Fork 11.9k
Closed
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
20.3.9
Description
In a workspace created with version 21.0.0-rc.0, containing several projects, all using the unit-test runner, running ng test --project <one-of-the-projects> tries to run the tests of all projects.
Minimal Reproduction
npx @angular/cli@21.0.0-rc.0 new vitestrepro --create-application=falsecd vitestreprong new application foong new application barng test --project foo
Exception or Error
Initial chunk files | Names | Raw size
spec-app-app.js | spec-app-app | 47.28 kB |
chunk-XSGC6WRG.js | - | 4.05 kB |
init-testbed.js | init-testbed | 998 bytes |
styles.css | styles | 69 bytes |
| Initial total | 52.40 kB
Application bundle generation complete. [2.339 seconds] - 2025-11-05T12:56:57.037Z
Watch mode enabled. Watching for file changes...
DEV v4.0.7 /Users/jb/tmp/vitestrepro
❯ foo projects/bar/src/app/app.spec.ts (2 tests | 2 failed) 7ms
× should create the app 5ms
× should render title 1ms
✓ foo projects/foo/src/app/app.spec.ts (2 tests) 93ms
⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Failed Tests 2 ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯
FAIL foo projects/bar/src/app/app.spec.ts > App > should create the app
FAIL foo projects/bar/src/app/app.spec.ts > App > should render title
Error: Component 'App' is not resolved:
- templateUrl: ./app.html
- styleUrl: ./app.css
Did you run and wait for 'resolveComponentResources()'?
❯ Function.get node_modules/@angular/core/fesm2022/_debug_node-chunk.mjs:17494:17
❯ getComponentDef node_modules/@angular/core/fesm2022/testing.mjs:1145:16
❯ isStandaloneComponent node_modules/@angular/core/fesm2022/testing.mjs:1141:15
❯ queueTypesFromModulesArrayRecur node_modules/@angular/core/fesm2022/testing.mjs:925:20
❯ TestBedCompiler.queueTypesFromModulesArray node_modules/@angular/core/fesm2022/testing.mjs:943:5
❯ TestBedCompiler.configureTestingModule node_modules/@angular/core/fesm2022/testing.mjs:567:12
❯ TestBedImpl.configureTestingModule node_modules/@angular/core/fesm2022/testing.mjs:1393:19
❯ Function.configureTestingModule node_modules/@angular/core/fesm2022/testing.mjs:1264:33
❯ projects/bar/src/app/app.spec.ts:6:19
4| describe('App', () => {
5| beforeEach(async () => {
6| await TestBed.configureTestingModule({
| ^
7| imports: [App],
8| }).compileComponents();
⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[1/2]⎯
Test Files 1 failed | 1 passed (2)
Tests 2 failed | 2 passed (4)
Start at 13:56:57
Duration 1.18s (transform 139ms, setup 547ms, collect 205ms, tests 100ms, environment 1.03s, prepare 16ms)
FAIL Tests failed. Watching for file changes...
press h to show help, press q to quit
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 : darwin x64
┌───────────────────────────┬───────────────────┬───────────────────┐
│ Package │ Installed Version │ Requested Version │
├───────────────────────────┼───────────────────┼───────────────────┤
│ @angular/build │ 21.0.0-rc.0 │ ^21.0.0-rc.0 │
│ @angular/cli │ 21.0.0-rc.0 │ ^21.0.0-rc.0 │
│ @angular/common │ 21.0.0-rc.0 │ ^21.0.0-next.0 │
│ @angular/compiler │ 21.0.0-rc.0 │ ^21.0.0-next.0 │
│ @angular/compiler-cli │ 21.0.0-rc.0 │ ^21.0.0-next.0 │
│ @angular/core │ 21.0.0-rc.0 │ ^21.0.0-next.0 │
│ @angular/forms │ 21.0.0-rc.0 │ ^21.0.0-next.0 │
│ @angular/platform-browser │ 21.0.0-rc.0 │ ^21.0.0-next.0 │
│ @angular/router │ 21.0.0-rc.0 │ ^21.0.0-next.0 │
│ rxjs │ 7.8.2 │ ~7.8.0 │
│ typescript │ 5.9.3 │ ~5.9.2 │
└───────────────────────────┴───────────────────┴───────────────────┘
Anything else relevant?
No response