title: Angular 2 - testing component with router-outlet
body: <p>I have created angular 2 project with angular-cli. I created separate AppRoutingModule which exports RouterModule and is added to AppModule imports array.</p>
  
  <p>I have also appComponent created by angular-cli.</p>
  
  <p>app.component.html</p>
  
  <pre><code>&lt;nav&gt;
    &lt;a *ngFor="let view of views" routerLink="{{ view.address }}" routerLinkActive="active"&gt;{{ view.text }}&lt;/a&gt;
  &lt;/nav&gt;
  &lt;router-outlet&gt;&lt;/router-outlet&gt;
  </code></pre>
  
  <p>app.component.spec.ts</p>
  
  <pre><code>import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
  import { TestBed, async } from '@angular/core/testing';
  import { AppComponent } from './app.component';
  
  
  describe('App: AquaparkFrontend', () =&gt; {
    beforeEach(() =&gt; {
      TestBed.configureTestingModule({
        declarations: [
          AppComponent
        ],
        schemas: [ CUSTOM_ELEMENTS_SCHEMA ]
      });
    });
  
    it('should create the app', async(() =&gt; {
      let fixture = TestBed.createComponent(AppComponent);
      let app = fixture.debugElement.componentInstance;
      expect(app).toBeTruthy();
    }));
  
    it(`should have 3 views`, () =&gt; {
      let fixture = TestBed.createComponent(AppComponent);
      let app = fixture.debugElement.componentInstance;
      expect(app.views.length).toEqual(3);
    });
  });
  </code></pre>
  
  <p>When I try to run tests with ng test I have error:</p>
  
  <pre><code> Can't bind to 'routerLink' since it isn't a known property of 'a'. ("&lt;nav&gt;
        &lt;a *ngFor="let view of views" [ERROR -&gt;]routerLink="{{ view.address }}" routerLinkActive="active"&gt;{{ view.text }}&lt;/a&gt;
      &lt;/nav&gt;
      &lt;router-outlet&gt;&lt;"
  </code></pre>
  
  <p>Do I miss something to import in test?</p>