resShouldContainHeader(headerName, headerValue, funcName)

A variant of 'shouldBeCalledWith' specifically designed for Http Headers. This function mocks the 'set' function (or the provided function name) on the response mock. This function should be used to set a header in the response.

In Express, you use the following syntax for for setting a header 'res.set("headerKey", "headerValue");'.

  • headerName {String} - The name of the header. i.e. The key.
  • headerValue {String} - The value of the header.
  • [funcName] {String} - Defaults to Expresses .set function.
  • returns {HttpReqScenario}