File tree Expand file tree Collapse file tree 1 file changed +39
-0
lines changed
Expand file tree Collapse file tree 1 file changed +39
-0
lines changed Original file line number Diff line number Diff line change 1+ import { RouterTestingModule } from '@angular/router/testing' ;
2+ import { BookStaticAsyncDataService } from './../shared/book-static-async-data.service' ;
3+ import { BookDataService } from '../shared/book-data.service' ;
4+ import { ComponentFixture , TestBed } from '@angular/core/testing' ;
5+
6+ import { BookListComponent } from './book-list.component' ;
7+ import { DebugElement } from '@angular/core' ;
8+
9+
10+ describe ( 'BookListComponent' , ( ) => {
11+ let component : BookListComponent ;
12+ let fixture : ComponentFixture < BookListComponent > ;
13+ let compiled ;
14+
15+ beforeEach ( ( ) => {
16+ TestBed . configureTestingModule ( {
17+ declarations : [
18+ BookListComponent
19+ ] ,
20+ imports : [
21+ RouterTestingModule . withRoutes ( [ ] )
22+ ] ,
23+ providers : [ { provide : BookDataService , useClass : BookStaticAsyncDataService } ]
24+ } )
25+ . compileComponents ( ) ;
26+ } ) ;
27+
28+ beforeEach ( ( ) => {
29+ fixture = TestBed . createComponent ( BookListComponent ) ;
30+ component = fixture . componentInstance ;
31+ fixture . detectChanges ( ) ;
32+ compiled = fixture . debugElement . nativeElement ;
33+ } ) ;
34+
35+ it ( 'should be created' , ( ) => {
36+ expect ( component ) . toBeTruthy ( ) ;
37+ } ) ;
38+
39+ } ) ;
You can’t perform that action at this time.
0 commit comments