I am trying to declare my ngrx/Store into the spec file for testing a container component. So I import the store first and inside the beforeEach do the following:
import {Store} from '@ngrx/store';
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [NotificationsComponent, NotificationsDevicesComponent,
ToArrayPipe, OrderByDate, TimezoneFormatPipe],
providers: [{ provide: Store, useClass: Store }]
})
.compileComponents().then(() => {
fixture = TestBed.createComponent(NotificationsComponent);
component = fixture.componentInstance;
el = fixture.debugElement;
fixture.detectChanges();
});
}));
But I got the error from the heading fails to resolve all parameters for Store: (?, ?, ?).
Any ideas?
Many thanks
cannot resolve parameters for foo: (?, ?)
usually means your dependency injection is not working properly (circular dependencies, bad imports, bad exports, etc). The question marks will indicate the dependencies. Sometimes it'll be like(FooService, BarService, ?)
, which means the third dependency is the one with the problem. – Lansana CamaraStore
directly from their file, not from a barrel, if that's what you're doing. – Lansana Camara