我試圖將我的ngrx/Store聲明爲測試容器組件的spec文件。所以我導入存儲第一和beforeEach內執行以下操作:角度測試:無法解決存儲的所有參數:(?,?,?)
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();
});
}));
但我從標題中的錯誤不能解決店鋪的所有參數:(,,???)。
任何想法?
非常感謝
'無法解析foo參數:(?,?)'通常意味着您的依賴注入工作不正常(循環依賴,壞導入,壞導出等)。問號將表明依賴關係。有時它會像'(FooService,BarService,?)',這意味着第三個依賴關係就是問題所在。 – Lansana
嘗試將他們想要注入的3個服務直接從文件中導入到Store中,而不是從桶中導入,如果這就是您正在做的。 – Lansana