karma error parent child code example
Example: karma error parent child
import { ChildComponent } from 'childComponent';
...
let component: ThisComponet;
let childComponent: ChildComponent;
.....
declarations: [ChildComponent],
.....
component = fixture.componentInstance;
// to get a handle on the child component, you can select it By.directive
childComponent = fixture.debugElement.query(By.directive(ChildComponent)).componentInstance;
// should have access to your childComponent public properties and methods now