Skip to content

Commit

Permalink
fixed restore not effect on http(s)
Browse files Browse the repository at this point in the history
  • Loading branch information
fengmk2 committed Dec 1, 2012
1 parent 4828345 commit 2692bd5
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions lib/mm.js
Original file line number Diff line number Diff line change
Expand Up @@ -110,14 +110,6 @@ exports.empty = function (mod, method, timeout) {
return exports.datas(mod, method, null, timeout);
};

/**
* remove all mock effects.
*/
exports.restore = function () {
muk.restore();
return this;
};

exports.http = {};
exports.https = {};

Expand Down Expand Up @@ -312,4 +304,14 @@ function _requestError(mod, url, reqError, resError, delay) {
return req;
};
return this;
}
}

/**
* remove all mock effects.
*/
exports.restore = function () {
http.request = http.__sourceRequest;
https.request = https.__sourceRequest;
muk.restore();
return this;
};

0 comments on commit 2692bd5

Please sign in to comment.