-
Notifications
You must be signed in to change notification settings - Fork 11.9k
Open
Labels
area: @angular-devkit/build-angularfeatureIssue that requests a new featureIssue that requests a new featurefeature: under considerationFeature request for which voting has completed and the request is now under considerationFeature request for which voting has completed and the request is now under consideration
Milestone
Description
Which @angular/* package(s) are relevant/related to the feature request?
core
Description
I was wondering if it is possible to have a coverage of the templates too. Sometimes the component typescript has no logic but everything exist in the .html
file. It would be nice that the coverage could see that an *ngIf
has been triggered in at least one test.
Proposed solution
Test coverage should say 50% branch coverage for this kind of template
@Component({
selector: 'ng-if-simple',
template: `
<div *ngIf="show === true">First 50% code coverage</div>
<br>
<div *ngIf="show === false">Last 50% code coverage</div>
`
})
export class NgIfSimple {
show = true;
}
Alternatives considered
I haven't tried anything yet. I wanted to see if the community has some input to give. Or if this idea of having coverage of templates isn't feasible at all.
mkznll, c-saner, alekrist, mbaechtold, Chavjoh and 34 moremminor-dev, ChadESmith42 and jbeverid
Metadata
Metadata
Assignees
Labels
area: @angular-devkit/build-angularfeatureIssue that requests a new featureIssue that requests a new featurefeature: under considerationFeature request for which voting has completed and the request is now under considerationFeature request for which voting has completed and the request is now under consideration