Is there some way I can find all active spies in sinon.js? I'd like to be able 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 laboriously (and error-pronedly!) do this:
it "should not create a new MyClass", ->
spy = sinon.spy(window, 'MyClass')
expect(spy).not.toHaveBeenCalled()
window.MyClass.restore()
Any ideas?