Repository navigation
Closed as duplicate
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
With 21.0.0-next.10 vitest produces several false reports for the covered branches.
Minimal Reproduction
This can already be observed when creating a new project, installing @vitest/coverage-v8 and running ng test --no-watch --coverage:
Here is a larger example that showcases several instances:
protected readonly title = signal('next-ten');
protected readonly someInput = input.required<string>();
constructor() {
if (true) {
console.log(this.title());
}
}
I also observed (so far only in a pipe) that implemented interfaces are not reported as covered:
@Pipe({
name: 'myTransform',
})
export class MyTransformPipe implements PipeTransform {
transform(value: string, ...args: unknown[]): unknown {
return value.toUpperCase();
}
}describe('MyTransformPipe', () => {
it('create an instance', () => {
const pipe = new MyTransformPipe();
expect(pipe).toBeTruthy();
expect(pipe.transform('test')).toBe('TEST');
});
});
Some more context:
Setting aot to false results in almost all lines getting covered. Only the if (true) case still reports that the else path was not taken.
With aot=false, karma produces 100% coverage.
But with aot=true, karma only reports these findings:
Exception or Error
Your Environment
Angular CLI : 21.0.0-next.10
Angular : 21.0.0-rc.0
Node.js : 24.11.0
Package Manager : npm 11.6.2
Operating System : darwin arm64
┌───────────────────────────┬───────────────────┬───────────────────┐
│ Package │ Installed Version │ Requested Version │
├───────────────────────────┼───────────────────┼───────────────────┤
│ @angular/build │ 21.0.0-next.10 │ ^21.0.0-next.10 │
│ @angular/cli │ 21.0.0-next.10 │ ^21.0.0-next.10 │
│ @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
Metadata
Metadata
Assignees
Labels
No labels
Activity
angular-automatic-lock-bot commentedon Nov 30, 2025
This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
This action has been performed automatically by a bot.