添加活动路由导入后,Jasmine测试用例失败。我已导入所需的所有依赖项。添加所有必需的导入以包括供应商的活动路径:
下面是茉莉花测试用例:
describe('StationConfigComponent', () => {
let activeRoute;
// let pdc : PdcWebClient;
let http: Http;
beforeEach(async(() => {
activeRoute = new MockActivatedRoute();
providers: [{ provide: Router, useClass: RouterStub }, { provide: service, useClass: DataservicesService},
{ provide: toastr, useClass: ToastrManager }, { provide: ActivatedRoute, useValue: activeRoute }, ,
{ provide: ngxXml2jsonService, useClass: NgxXml2jsonService }, { provide: cdrDetect, useClass: ChangeDetectorRef },
// { provide: pdc, useClass: PdcWebClient },
{ provide: cdrDetect, useClass:
describe('StationConfigComponent', () => {
以下是错误:
错误:遇到未定义的提供者!通常,这意味着您具有循环依赖关系。这可能是由于使用“桶” index.ts文件引起的。