ensure http errors reject promises

This commit is contained in:
Leo Horie 2014-05-26 21:57:09 -04:00
parent ea0b661b79
commit b9cdd940bc
4 changed files with 18 additions and 19 deletions

View file

@ -88,10 +88,12 @@ mock.window = new function() {
}
this.send = function() {
this.responseText = JSON.stringify(this)
request.$events.push({type: "load", target: this})
this.readyState = 4
this.status = 200
request.$instances.push(this)
}
}
request.$events = []
request.$instances = []
return request
}
window.location = {search: "", pathname: "", hash: ""},