Skip to content

Unit test error: Router outlet is not a known element #11057

@mariadigiledge

Description

@mariadigiledge

i am getting following error when running a unit test using karma and jasmine

Error:
Failed: Template parse errors:
'router-outlet' is not a known element:

  1. If 'router-outlet' is an Angular component, then verify that it is part of this module.
  2. If 'router-outlet' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the '@NgModule.schemas' of this component to suppress this message. ("
    home
[ERROR ->] "): ng:///DynamicTestModule/AppComponent.html@5:2

My app.module.ts

screen shot 2018-05-29 at 7 27 17 pm

app.component.html
screen shot 2018-05-29 at 7 27 35 pm

app.component.ts
screen shot 2018-05-29 at 7 27 29 pm

app.component.spec.ts
screen shot 2018-05-29 at 7 27 56 pm

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions