diff options
Diffstat (limited to 'helpers/FakeHttpProvider.js')
-rw-r--r-- | helpers/FakeHttpProvider.js | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/helpers/FakeHttpProvider.js b/helpers/FakeHttpProvider.js index 20d1f258..0b01a171 100644 --- a/helpers/FakeHttpProvider.js +++ b/helpers/FakeHttpProvider.js @@ -26,7 +26,7 @@ FakeHttpProvider.prototype.send = function (payload) { // imitate plain json object this.validation(JSON.parse(JSON.stringify(payload))); } - return this.response; + return this.getResponse(); }; FakeHttpProvider.prototype.sendAsync = function (payload, callback) { @@ -36,7 +36,7 @@ FakeHttpProvider.prototype.sendAsync = function (payload, callback) { // imitate plain json object this.validation(JSON.parse(JSON.stringify(payload)), callback); } - callback(this.error, this.response); + callback(this.error, this.getResponse()); }; FakeHttpProvider.prototype.injectResponse = function (response) { @@ -56,6 +56,10 @@ FakeHttpProvider.prototype.injectBatchResults = function (results) { }); }; +FakeHttpProvider.prototype.getResponse = function () { + return this.response; +}; + FakeHttpProvider.prototype.injectError = function (error) { this.error = error; }; |