Change rewire dev dependency with sinon.js

Description

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.

Environment

None

Pull Requests

None

Activity

Show:
Jorge Bay Gondra
July 15, 2019, 6:38 PM

Also, rewire has a large dependency tree (thanks to eslint) of 100+ packages.

Instead, sinon.js has 15.

Jorge Bay Gondra
October 7, 2019, 9:30 PM

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.

Done

Assignee

Jorge Bay Gondra

Reporter

Jorge Bay Gondra

Reviewer

None

Fix versions

None

Labels

None

Components

None

PM Priority

None

Pull Request

None

Priority

Major