merged develop

This commit is contained in:
Fabian Vogelsteller 2015-09-15 10:58:32 +02:00
commit d09f65b24f
1 changed files with 6 additions and 1 deletions

View File

@ -44,6 +44,7 @@ FakeHttpProvider.prototype.send = function (payload) {
};
FakeHttpProvider.prototype.sendAsync = function (payload, callback) {
assert.equal(utils.isArray(payload) || utils.isObject(payload), true);
assert.equal(utils.isFunction(callback), true);
if (this.validation) {
@ -51,7 +52,11 @@ FakeHttpProvider.prototype.sendAsync = function (payload, callback) {
this.validation(JSON.parse(JSON.stringify(payload)), callback);
}
callback(this.error, this.getResponse(payload));
var response = this.getResponse();
var error = this.error;
setTimeout(function(){
callback(error, response);
});
};
FakeHttpProvider.prototype.injectResponse = function (response) {