I am creating my unit tests with Jasmine and I have a question about the branch covered.
Does anyone know why the code part shows that the branches are not covered as we can see below?
This is the unit test:
describe('MyComponent', () => {
let component: MyComponent;
let fixture: ComponentFixture<MyComponent>;
let myService: MyService;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ MyComponent ],
imports: [ MaterializeModule, FormsModule, ReactiveFormsModule, HttpModule ],
providers: [
MyService,
FormBuilder
]
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(MyComponent);
component = fixture.componentInstance;
slotsService = TestBed.get(MyService);
fixture.detectChanges();
});
function updateForm(name, surname) {
component.myForm.controls['name'].setValue(name);
component.myForm.controls['surname'].setValue(name);
}
it('should create', () => {
expect(component).toBeTruthy();
});
}