WIP: 6: Get Data from a Server k) Search by name master
authorKai Moritz <kai@juplo.de>
Sat, 27 Jun 2020 12:44:53 +0000 (14:44 +0200)
committerKai Moritz <kai@juplo.de>
Sat, 27 Jun 2020 12:44:53 +0000 (14:44 +0200)
src/app/hero-search/hero-search.component.spec.ts

index 901bb7f..335a305 100644 (file)
@@ -1,6 +1,9 @@
 import { async, ComponentFixture, TestBed } from '@angular/core/testing';
 
 import { HeroSearchComponent } from './hero-search.component';
+import { HeroService } from '../hero.service';
+
+class MockHeroService {}
 
 describe('HeroSearchComponent', () => {
   let component: HeroSearchComponent;
@@ -8,7 +11,8 @@ describe('HeroSearchComponent', () => {
 
   beforeEach(async(() => {
     TestBed.configureTestingModule({
-      declarations: [ HeroSearchComponent ]
+      declarations: [ HeroSearchComponent ],
+      providers: [ { provide: HeroService, useClass: MockHeroService } ]
     })
     .compileComponents();
   }));