Is there a way to find all active spies in sinon.js? I would like to do something like this:
afterEach -> sinon.restoreAllSpies() it "should not create a new MyClass", -> spy = sinon.spy(window, 'MyClass') expect(spy).not.toHaveBeenCalled()
Currently, I need to do this with difficulty (and with an error!):
it "should not create a new MyClass", -> spy = sinon.spy(window, 'MyClass') expect(spy).not.toHaveBeenCalled() window.MyClass.restore()
Any ideas?
javascript jasmine sinon
bhuga
source share