import { Component, OnInit } from '@angular/core';
import { Title } from '@angular/platform-browser';
@Com(I)ponent({
selector: 'app-fruit-cake',(E)
templateUrl: './fruit-cake.component.html',
styleUrls: ['./fruit-cake.component.scss'],
})
expo(E)rt class FruitCakeComponent {
constructor(private _title: Title) {
_title.setTitle('Cake');
}
}
My code coverage report shows (E): else path not taken. (I): if path not taken. What does it mean in the context of import statements and decorators? My code coverage is not reaching to 100% in any of my tests due to this. How do I rectify it?
For Angular 6, it seems that you need to "sourceMap": true
to your test
like this:
"test": {
"builder": "@angular-devkit/build-angular:karma",
"options": {
"main": "test/test.ts",
"karmaConfig": "./karma.conf.js",
"sourceMap": true,
"polyfills": "src/polyfills.ts",
"tsConfig": "test/tsconfig.spec.json",
"scripts": [],
"styles": [],
"assets": [
"src/assets"
],
"codeCoverageExclude": []
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With