Angular 2.0.0 - Testing " imported by the module 'DynamicTestModule' "

Discussão em 'Angular' iniciado por xiotee, Março 21, 2025.

  1. xiotee

    xiotee Guest

    I am having a problem in testing app.component.ts in Angular 2. I am using angular-cli. Whenever I run ng test, my app.component.spec.ts makes the console prompt with the error:

    Failed: Unexpected directive 'HomeModuleComponent' imported by the module 'DynamicTestModule'
    Error: Unexpected directive 'HomeModuleComponent' imported by the module 'DynamicTestModule'


    I imported the HomeModuleComponent in TestBed

    TestBed.configureTestingModule({
    declarations: [AppComponent],
    imports : [ HomeModuleComponent ]
    });


    Can anyone help me with this problem?

    Continue reading...

Compartilhe esta Página