mardi 28 août 2018

Angular 'router-outlet' is not a known element

I'm trying to test my app but not able after adding routing. For now I have that test

describe('AppComponent', () => {
  beforeEach(async(() => {
    TestBed.configureTestingModule({
      imports: [
        RouterTestingModule
      ],
      declarations: [
        AppComponent,
        NavbarComponent,
        IndexComponent,
        ProjectsComponent,
        BioComponent,
        SiteComponent,
        SiteItemComponent
      ],
    }).compileComponents();
  }));
  it('should create the app', async(() => {
    const fixture = TestBed.createComponent(AppComponent);
    const app = fixture.debugElement.componentInstance;
    expect(app).toBeTruthy();
  }));
});

Everywhere is written that it's worth to add RouterTestingModule however it was added from the beginning since Angular CLI generated it.

Aucun commentaire:

Enregistrer un commentaire