Question 1 / 1
A test subscribes to service.getOrders(), calls httpMock.expectOne(url), flushes a response, then asserts on the result. The test passes. In afterEach, httpMock.verify() is called. The service actually makes two HTTP requests — one to /orders and one to /users/me on every call. What happens when verify() runs?
typescript it('fetches orders', () => { let result: Order[]; service.getOrders().subscribe(o => result = o);
const req = httpMock.expectOne('https://api.myapp.com/v2/orders'); req.flush(fakeOrders);
expect(result.length).toBe(2); // passes });
afterEach(() => httpMock.verify());