2 ms·
There's also stuff like rewire [0], which lets you change required values inside modules. Although every time I've tried it, I found it created more problems th
by TheAceOfHearts 11y ago
There's also stuff like rewire [0], which lets you change required values inside modules. Although every time I've tried it, I found it created more problems than it was solving.
[0] https://www.npmjs.com/package/rewire https://www.npmjs.com/package/rewire
- madeofpalk 11y agoProxyquire - https://github.com/thlorenz/proxyquire https://github.com/thlorenz/proxyquire - is a nicer way to solve many of the problems that people tend to use rewire for. We use it to stub out imports in our unit tests and find it very easy.