beforeEach(() => { ... httpMock = TestBed.get(HttpTestingController); }); afterEach(() => httpMock.verify()); it('should successfully mock request', () => { const response = {...}; service.fetch().subscribe(result => expect(result).toBe(response)); const req = httpMock.expectOne(`/api/v1/samples`); expect(req.request.method).toEqual('GET'); req.flush(response); }); }); 18