aboutsummaryrefslogtreecommitdiffstats
path: root/src/angular-mocks.js
diff options
context:
space:
mode:
authorVojta Jina2011-11-03 15:17:32 -0700
committerIgor Minar2011-11-30 11:17:24 -0500
commit9b4efa73f9eef7c22895ca269760eb11ecb54b30 (patch)
tree12886a39600b178d8d58b246168766354fd7d9b4 /src/angular-mocks.js
parent4aaa2f7f6b37f0ad8255e6a320e9136a89e329de (diff)
downloadangular.js-9b4efa73f9eef7c22895ca269760eb11ecb54b30.tar.bz2
feat(mock.$httpBackend): say which request was expected when unexpected request error
Diffstat (limited to 'src/angular-mocks.js')
-rw-r--r--src/angular-mocks.js6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/angular-mocks.js b/src/angular-mocks.js
index 60211e6f..6f69f0d6 100644
--- a/src/angular-mocks.js
+++ b/src/angular-mocks.js
@@ -631,8 +631,10 @@ angular.module.ngMock.$HttpBackendProvider = function() {
return method == 'JSONP' ? undefined : xhr;
}
}
- throw wasExpected ? Error('No response defined !') :
- Error('Unexpected request: ' + method + ' ' + url);
+ throw wasExpected ?
+ Error('No response defined !') :
+ Error('Unexpected request: ' + method + ' ' + url + '\n' +
+ (expectation ? 'Expected ' + expectation : 'No more request expected'));
}
$httpBackend.when = function(method, url, data, headers) {