2016-07-13 8 views
1

ではありませんが、Angular2で私のテストで:Angular2 RC4テスト:(約束で)キャッチされない:TypeError例外:。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

RC4にアップデートするまでAngular2 RC2で正常に動作します。

答えて

関連する問題