javascript - Angular $httpBackend.expectGET - respond with 409 status & custom statusText -
trying create $httpbackend.expectget in unit test return status of 409 , custom statustext of 'testphrase'. looking @ angular docs ( https://docs.angularjs.org/api/ngmock/service/$httpbackend ) gives following example of returned: {function([status,] data[, headers, statustext]) | function(function(method, url, data, headers)} having trouble understanding how interpret above example. my current code is: $httpbackend .expectget('/example/url') .respond(function () { return ['409', ['testphrase'], {}]; }); the code i'm testing is: $http.get('/example/url').then(function (response) { console.log('success, status ' + response.status); console.log('success, statustext ' + response.statustext); }, function(response) { console.log('error, status ' + response.status); console.log('error, statustext ' + response.statustext); ...