title: Angular 2: Testing components with router
body: <p>I am writing the simplest component that is using a routeLink:</p>
  <pre><code>@Component({
      selector: 'memorySnippet',
      templateUrl: '&lt;div class=&quot;memory-snippet-wrapper&quot; *ngIf=&quot;memory&quot; 
                    [routerLink]=&quot;['MainPanel', 'MemoryPanel', {'id' : this.memory.id}]&quot;&gt;',
      directives: [CORE_DIRECTIVES, ROUTER_DIRECTIVES]
  })
  export class MemorySnippetComponent {
      @Input() memory: Memory;
  }
  </code></pre>
  <p>The problem occurs when I try testing this component. The moment I add the router link Karma is complaining about missing providers:</p>
  <p>After adding all the providers Karma is asking I get this:</p>
  <pre><code>beforeEachProviders(() =&gt; [
      MemorySnippetComponent,
      MEMORY_SERVICE_PROVIDERS,
      ROUTER_PROVIDERS,
      ApplicationRef
  ]);
  </code></pre>
  <p>But when I run the test I get this error:</p>
  <blockquote>
  <p>EXCEPTION: EXCEPTION: Error during instantiation of Token RouterPrimaryComponent! (RouterLink -&gt; Router -&gt; RouteRegistry -&gt; Token RouterPrimaryComponent).</p>
  <p>ORIGINAL EXCEPTION: unimplemented</p>
  <p>ORIGINAL STACKTRACE:
  Error: unimplemented</p>
  </blockquote>
  <p>What am I doing wrong??? Is Angular 2 (2.0.0-beta.1) just not ready for testing components with router directives?</p>