jhnns / rewire

Easy monkey-patching for node.js unit tests
MIT License
3.08k stars 127 forks source link

simultaneous usage of rewire and proxyquire #81

Open hellboy81 opened 8 years ago

hellboy81 commented 8 years ago

As I mentioned with proxyquire it is not possible to access private variables on module level. It is only possible with rewire.

Conversely, rewire cannot stub require itself. I.e. all modules are loaded, although they should be stubbed and are not required installed for unit tests.

Is there possible to use both of this libraries simultaneously?

TheSavior commented 8 years ago

We use both libraries by using rewire-global for node, and rewireify for the browser.

jhnns commented 8 years ago

I'm thinking about providing an option to specify the dependencies because this feature has been requested very often. #73