sezna / nps

NPM Package Scripts -- All the benefits of npm scripts without the cost of a bloated package.json and limits of json
MIT License
1.43k stars 92 forks source link

Refactor nps tests #153

Open kentcdodds opened 6 years ago

kentcdodds commented 6 years ago

Let's get rid of sinon and just use jest's built-in mock functions.

Also, we use jest.mock in a pretty sub-optimal way. We really shouldn't be doing jest.mock calls inside of functions. Those should go at the top of the module where we're calling it.

Also, doing inline jest.mock is not the best. We should probably write these mocks in __mocks__ directories (see the Jest docs).

Miklet commented 6 years ago

162 removed sinon from tests. Mocks still need improvement 🙂