我已升级到7号角,并且我所有的DI单元测试现在都发出警告:“规格没有预期”。
我尝试使用异步测试规范和回调(完成)。当我使用回调时,测试将超时并失败。我还尝试扩展默认的茉莉花超时。
fdescribe('Service Test', () => {
let serviceToTest: ServiceToTest;
let injectedService: InjectedService;
beforeEach(() => {
TestBed.configureTestingModule({
providers: [ ServiceToTest, InjectedService ]
}).compileComponents();
serviceToTest = TestBed.get(ServiceToTest);
injectedService = TestBed.get(InjectedService);
});
it('injectedService should be the same as InjectedService injected by DI', () => {
inject([InjectedService], (iService: InjectedService) => {
expect(iService).toBe(injectedService);
});
});
});