angular.mock.service.$browser.xhr

Description

Generic method for training browser to expect a request in a test and respond to it.

See also convenience methods for browser training:

To flush pending requests in tests use $browser.xhr.flush.

Usage

$browser.xhr(method, url[, data], callback, headers);

Parameters

Returns

{object}

Response configuration object. You can call its respond() method to configure what should the browser mock return when the response is flushed.