vendredi 18 mai 2018

Error: Cannot create the component ComponentClass as it was not imported into the testing module

I have the above test base set up on an Angular Cli 6.0.1 app.

Using Jasmine V2.8.0 and Karma V2.0.0

I'm getting the following error on line 13

Error: Cannot create the component AddressLookUpDirective as it was not imported into the testing module!

Can’t figure out what is going wrong.. any suggestions most welcome

import { TestBed, ComponentFixture } from '@angular/core/testing';
import { BrowserDynamicTestingModule, platformBrowserDynamicTesting } from '@angular/platform-browser-dynamic/testing';

import { AddressLookUpDirective } from './address-look-up.directive';

describe('AddressLookUpDirective', () => {

    let component: AddressLookUpDirective;
    let fixture: ComponentFixture<AddressLookUpDirective>;

    beforeEach(() => {

        TestBed.configureTestingModule({
        declarations: [
            AddressLookUpDirective
          ]
        });

       fixture = TestBed.createComponent(AddressLookUpDirective);
       component = fixture.componentInstance;

   });
});

Aucun commentaire:

Enregistrer un commentaire