1- import { TestBed , waitForAsync } from '@angular/core/testing' ;
1+ import { TestBed } from '@angular/core/testing' ;
22import { JsonapiConfig } from '../jsonapi-config' ;
3- import { HttpClientTestingModule } from '@angular/common/http/testing' ;
3+ import { provideHttpClient } from '@angular/common/http' ;
4+ import { provideHttpClientTesting } from '@angular/common/http/testing' ;
45import { tap , mapTo , share } from 'rxjs/operators' ;
56import { Observable , of , timer , Subject } from 'rxjs' ;
67
@@ -20,14 +21,18 @@ describe('Http service', () => {
2021 } ,
2122 meta : { meta : 'meta' }
2223 } ;
23- beforeEach ( waitForAsync ( ( ) => {
24+ beforeEach ( ( ) => {
2425 TestBed . configureTestingModule ( {
25- imports : [ HttpClientTestingModule ] ,
26- providers : [ Http , { provide : JsonapiConfig , useValue : JsonapiConfigMock } ]
27- } ) . compileComponents ( ) ;
28- } ) ) ;
29- it ( 'should create Http service' , ( ) => {
26+ providers : [
27+ Http ,
28+ { provide : JsonapiConfig , useValue : JsonapiConfigMock } ,
29+ provideHttpClient ( ) ,
30+ provideHttpClientTesting ( )
31+ ]
32+ } ) ;
3033 service = TestBed . inject ( Http ) ;
34+ } ) ;
35+ it ( 'should create Http service' , ( ) => {
3136 expect ( service ) . toBeTruthy ( ) ;
3237 } ) ;
3338 it ( 'exec should return an observable with the http request' , async ( ) => {
0 commit comments