Is there a way to easily reset all sinon spys mocks and stubs that will work cleanly with mocha\'s beforeEach blocks.
I see sandboxing is an option but I do not see
If you want a setup that will have sinon always reset itself for all tests:
in helper.js:
import sinon from 'sinon'
var sandbox;
beforeEach(function() {
this.sinon = sandbox = sinon.sandbox.create();
});
afterEach(function() {
sandbox.restore();
});
Then, in your test:
it("some test", function() {
this.sinon.stub(obj, 'hi').returns(null)
})