あいつの日誌β

働きながら旅しています。

ng test で Can't bind to 'routerLink' since it isn't a known property of 'a'. のような事を言われる場合

xxxx.component.spec.ts に以下のような追記をすると良いかもしれません。

+ import { RouterTestingModule } from '@angular/router/testing';


   beforeEach(async(() => {
     TestBed.configureTestingModule({
       ...
+      imports: [RouterTestingModule]
     })
     .compileComponents();