-
Notifications
You must be signed in to change notification settings - Fork 11.9k
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 rarelyseverity3: brokentype: 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
No response
Description
Running ng test
with codeCoverage enabled generates reports with 0% coverage out of the box.
Minimal Reproduction
Generate a new app:
npx @angular/[email protected] new vitest-coverage --no-routing --defaults
cd vitest-coverage
npm install vitest jsdom @vitest/coverage-v8 --save-dev
Use the unit-test builder:
"test": {
"builder": "@angular/build:unit-test",
"options": {
"tsConfig": "tsconfig.spec.json",
"buildTarget": "::development",
"runner": "vitest",
"codeCoverage": true
}
}
Run ng test --no-watch
Exception or Error
% Coverage report from v8
----------------|---------|----------|---------|---------|-------------------
File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s
----------------|---------|----------|---------|---------|-------------------
All files | 0 | 0 | 0 | 0 |
src | 0 | 0 | 0 | 0 |
main.ts | 0 | 0 | 0 | 0 | 1-6
src/app | 0 | 0 | 0 | 0 |
app.config.ts | 0 | 0 | 0 | 0 | 1-9
app.ts | 0 | 0 | 0 | 0 | 1-11
----------------|---------|----------|---------|---------|-------------------
Your Environment
Angular CLI: 20.1.0-next.2
Node: 22.14.0
Package Manager: npm 10.9.0
OS: darwin arm64
Angular: 20.1.0-next.1
... common, compiler, compiler-cli, core, forms
... platform-browser, router
Package Version
------------------------------------------------------
@angular-devkit/architect 0.2001.0-next.2
@angular-devkit/core 20.1.0-next.2
@angular-devkit/schematics 20.1.0-next.2
@angular/build 20.1.0-next.2
@angular/cli 20.1.0-next.2
@schematics/angular 20.1.0-next.2
rxjs 7.8.2
typescript 5.8.3
zone.js 0.15.1
Anything else relevant?
Two additional points:
- computing the coverage is very slow
- the template files aren't included whereas they should as it runs in AoT mode
marcalj and teoeter
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 rarelyseverity3: brokentype: bug/fix