Angular2 RC4测试:未捕获的(在承诺):类型错误:testing_1.expect(...)toBeAnInstanceOf不是一个函数
问题描述:
这是我在Angular2测试:Angular2 RC4测试:未捕获的(在承诺):类型错误:testing_1.expect(...)toBeAnInstanceOf不是一个函数
it('should initialize without DI service',
async(inject([TestComponentBuilder], (tcb: TestComponentBuilder) => {
var template = '<component></component>';
return tcb.overrideTemplate(TestComponent, template)
.createAsync(TestComponent)
.then((fixture) => {
expect(fixture.debugElement.children[0].componentInstance).toBeAnInstanceOf(ComponentType);
expect(fixture.debugElement.children[0].componentInstance.state).toBeNull();
});
})));
它引发以下错误:
Uncaught (in promise): TypeError: testing_1.expect(...).toBeAnInstanceOf is not a function
它在Angular2 RC2中正常工作,直到我更新到RC4。