Skip to content

Commit

Permalink
Remove abort mock (checked on superagent). Add .idea to gitignore. (#61)
Browse files Browse the repository at this point in the history
  • Loading branch information
elisherer authored and DevSide committed May 24, 2017
1 parent d3a4040 commit 978e841
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 8 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ node_modules
*.log
lib
es
.idea
8 changes: 0 additions & 8 deletions src/superagent-mock.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ module.exports = function (superagent, config, logger) {
* Keep the default methods
*/
const oldEnd = Request.prototype.end;
const oldAbort = Request.prototype.abort;

/**
* Flush the current log in the logger method and reset it
Expand Down Expand Up @@ -200,16 +199,9 @@ module.exports = function (superagent, config, logger) {
return this;
};

Request.prototype.abort = function () {
this.xhr = this.req = {abort: function () {}};

return oldAbort.call(this);
};

return {
unset: function () {
Request.prototype.end = oldEnd;
Request.prototype.abort = oldAbort;
}
};
};

0 comments on commit 978e841

Please sign in to comment.