Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@jhartikainen
Last active March 24, 2016 14:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jhartikainen/23557771ce0970bd8605 to your computer and use it in GitHub Desktop.
Save jhartikainen/23557771ce0970bd8605 to your computer and use it in GitHub Desktop.
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