We use rewire in our tests, to patch module dependencies and fake them.
rewire is not being actively maintained. We should replace it with sinon.js.
Note that this only affects our tests setup and dependencies, as rewire and sinon will not be installed for our users as it's a dev dependency.
Also, rewire has a large dependency tree (thanks to eslint) of 100+ packages.
Instead, sinon.js has 15.
Replaced rewire (not maintained) with proxyquire.
Added sinon for fake timers, stubs and spies and chai to simplify assertions.
Dev dependencies tree went from 138 to 51. Production dependencies tree still at 3.