sinon-sandbox
Sinon-sandbox is a testing utility to make it easy to restore stubs after every test, agnostic of your team's testing framework of choice.
Installation
$ npm install sinon-sandbox --save-dev
Usage
In order to restore your sinon stubs after every test, call restore
in an afterEach hook.
// in a file included at the beginning of your test suitevar sinon = ;
When writing tests, require sinon-sandbox
. Since it returns an instance of a sandbox, you can treat it just like the original sinon module.
var sinon = ; sinon;