Question · Angular course · Module 11: Testing

Verifying the request method

How do you check that the intercepted request used the POST method?

Answer options

  • expect(req.method).toBe('POST')
  • expect(req.type).toEqual('POST')
  • expect(req.request.method).toBe('POST')
  • expect(httpMock.method).toBe('POST')

You can check the correct answer by solving this task in the CodeWorlds game.