Skip to content

Instantly share code, notes, and snippets.

@jhartikainen
Last active Mar 24, 2016
Embed
What would you like to do?
Manual Sinon sandboxes
describe('something', function() {
var sandbox;
beforeEach(function() {
sandbox = sinon.sandbox.create();
});
afterEach(function() {
sandbox.restore();
});
it('should do something with stubs', function() {
var someStub = sandbox.stub(thing, 'something');
//stuff
})
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment