X-Git-Url: https://juplo.de/gitweb/?p=examples%2Fangular-tour-of-heroes;a=blobdiff_plain;f=src%2Fapp%2Fdashboard%2Fdashboard.component.spec.ts;h=bfadb0908ee2822565f4cdfa5304afe8227bcb84;hp=9c996c371f1abfaf6c906b6ee96c9ed9b8612c4f;hb=b52b79a39e71932d1413cfbeca4d4ae3a50fe35b;hpb=f48ad6f3e3fa28778b2648a505706cc95ee51978 diff --git a/src/app/dashboard/dashboard.component.spec.ts b/src/app/dashboard/dashboard.component.spec.ts index 9c996c3..bfadb09 100644 --- a/src/app/dashboard/dashboard.component.spec.ts +++ b/src/app/dashboard/dashboard.component.spec.ts @@ -1,6 +1,8 @@ import { async, ComponentFixture, TestBed } from '@angular/core/testing'; import { DashboardComponent } from './dashboard.component'; +import { HeroService } from '../hero.service'; +import { of } from 'rxjs'; describe('DashboardComponent', () => { let component: DashboardComponent; @@ -8,7 +10,10 @@ describe('DashboardComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ DashboardComponent ] + declarations: [ DashboardComponent ], + providers: [ + { provide: HeroService, useValue: { getHeroes: () => of([])}} + ] }) .compileComponents(); }));