Open xavierchow opened 8 years ago
This issue would occurs when mm
and nock
be used together?
This issue would occurs when mm and nock be used together?
Yes, also other modules which alter the underlying http.request
.
it is most likely two hacks can not work correctly together..
I think this issue is inevitable, but yes we can attempt to avoid them
2015-11-30 11:09 GMT+08:00 xavier notifications@github.com:
This issue would occurs when mm and nock be used together?
Yes, also other modules which alter the underlying http.request.
— Reply to this email directly or view it on GitHub https://github.com/node-modules/mm/issues/24#issuecomment-160505620.
It's fine if I use mm.http.request
and there's a conflict with other lib which also changes http.request
.
But even if I only use the stub feature(underlying muk), the mm.restore
still touches the http.request
by force. That's the problem I think mm.restore
does too much.
Some other libraries such as nock also alter the
http.request
, as long as you require themm
, even you don't use themm.http.request
, therestore
changes it with the origin one(at the context of require moment) by force, which is not expected, see sample below,