when

http.when([method], [url])

The when method allows you to define responses for certain calls.

Both the method and url are optional, and can either be a string or a regular expression.

When a request matches multiple response definitions, the last response will always be used

You can chain multiple actions together, the last action will be used as the response value:

http.when('api/1').call(spy).return({});

The when method returns an object with the following options...

results matching ""

    No results matching ""