2016-07-13 2 views
1

Hier ist mein Test in Angular2:Angular2 RC4 Prüfung: Uncaught (in Versprechen): Typeerror:. Testing_1.expect (...) toBeAnInstanceOf ist keine Funktion

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(); 
       }); 
     }))); 

Es wird folgende Fehler wirft:

Uncaught (in promise): TypeError: testing_1.expect(...).toBeAnInstanceOf is not a function

Es funktioniert gut in Angular2 RC2, bis ich auf RC4 aktualisiert.

Antwort

Verwandte Themen