我试图将我的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