Change angular-mocks to throw errors on unexpected gets in the format JSTD now expects

This commit is contained in:
Shyam Seshadri 2010-10-07 09:31:19 -07:00 committed by Misko Hevery
parent a930e782a5
commit c30807d141

View file

@ -75,7 +75,10 @@ function MockBrowser() {
var expect = expectations[method] || {};
var response = expect[url];
if (!response) {
throw "Unexepected request for method '" + method + "' and url '" + url + "'.";
throw {
message: "Unexpected request for method '" + method + "' and url '" + url + "'.",
name: "Unexpected Request"
};
}
requests.push(function(){
callback(response.code, response.response);