rewire icon indicating copy to clipboard operation
rewire copied to clipboard

simultaneous usage of rewire and proxyquire

Open hellboy81 opened this issue 8 years ago • 2 comments

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?

hellboy81 avatar Oct 27 '15 08:10 hellboy81

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

TheSavior avatar Oct 29 '15 16:10 TheSavior

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

jhnns avatar Mar 16 '16 00:03 jhnns