import { HttpClient } from '@angular/common/http'; import { of, } from 'rxjs'; import { response as mockResponse } from './index'; export const initMockHttp = (jest) => (response = mockResponse(jest)()) => { const mockHttp = new HttpClient(null); mockHttp.get = jest.fn(() => of(response)); mockHttp.post = jest.fn(() => of(response)); return mockHttp; };