Failed: No base href set. Please provide a value for the APP_BASE_HREF token or add a base element to the document.
TestBed.configureTestingModule({
providers: [
{provide: APP_BASE_HREF, useValue : '/' }
]
}).compileComponents();
providers에 APP_BASE_HREF 추가하면 된다.
Error: StaticInjectorError(DynamicTestModule)[MessagesComponent -> MessageService]:
StaticInjectorError(Platform: core)[MessagesComponent -> MessageService]:
NullInjectorError: No provider for MessageService!
TestBed.configureTestingModule({
providers: [
MessageService
]
}).compileComponents();
MessageService를 찾아서 providers에 추가해주면 된다.
Failed: Template parse errors:
Can't bind to 'routerLink' since it isn't a known property of 'a'. ("<h3>Top Heroes</h3>
<div class="grid grid-pad">
<a *ngFor="let hero of heroes" class="col-1-4" [ERROR ->]routerLink="/detail/{{hero.id}}">
<div class="module hero">
<h4>{{hero.name}}</h4"): ng:///DynamicTestModule/DashboardComponent.html@2:51
TestBed.configureTestingModule({
imports: [
RouterTestingModule
],
declarations: [ DashboardComponent ]
})