失败:无法解析DecoratorFactory的所有参数:(?)

时间:2018-06-26 10:02:54

标签: angular typescript karma-jasmine

我运行ng test进行单元测试时遇到以下异常 Failed: Can't resolve all parameters for DecoratorFactory: (?)

在下面的specs.ts文件中处理异常。我在用户界面中使用ngx-bootstrap组件

describe('DirectoryComponent', () => {
    let component: DirectoryComponent;
    let fixture: ComponentFixture<DirectoryComponent>;

    beforeEach(async(() => {
        TestBed.configureTestingModule({
            declarations: [ DirectoryComponent ],
            imports: [ FormsModule,TypeaheadModule,BsDatepickerModule, CarouselModule, RouterTestingModule,ModalModule.forRoot() ],
            providers:[GlobalService, ServerService , OtherservicesService,MyModalsService,Pipe],
        }).compileComponents();
    }));

    beforeEach(() => {
        fixture = TestBed.createComponent(DirectoryComponent);
        component = fixture.componentInstance;
        fixture.detectChanges();
    });

    it('should create', () => {
        expect(component).toBeTruthy();
    });
});

0 个答案:

没有答案