Test Angular 2 Component with Constructor Parameter Test Angular 2 Component with Constructor Parameter angular angular

Test Angular 2 Component with Constructor Parameter


As pointed ou by JB Nizet, when a component has @input parameters, you need to init them in the beforeEach() :```

beforeEach(() => {    fixture = TestBed.createComponent(SomeComponent);    component = fixture.componentInstance;    component.a = 1;    component.b = 2;    fixture.detectChanges();});

```