This Question have no Text answers yet!

Angular2 RC4 testing: Uncaught (in promise): TypeError: testing_1.expect(…).toBeAnInstanceOf is not a function

Question!

Here is my test in Angular2:

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

It throws the following error:

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

It works fine in Angular2 RC2 till I updated to RC4.

By : P.Petkov


Video about Angular2 RC4 testing: Uncaught (in promise): TypeError: testing_1.expect(…).toBeAnInstanceOf is not a function