Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

Commit c3e0d58

Browse files
xfggkalpak
authored andcommitted
docs(ngMock/$httpBackend): add catch() block to example
Make the `it should fail authentication` test pass. Closes #15822
1 parent f08156e commit c3e0d58

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/ngMock/angular-mocks.js

+2
Original file line numberDiff line numberDiff line change
@@ -1133,6 +1133,8 @@ angular.mock.dump = function(object) {
11331133
$http.get('/auth.py').then(function(response) {
11341134
authToken = response.headers('A-Token');
11351135
$scope.user = response.data;
1136+
}).catch(function() {
1137+
$scope.status = 'Failed...';
11361138
});
11371139
11381140
$scope.saveMessage = function(message) {

0 commit comments

Comments
 (0)