This is an old revision of the document!
Sinon JS
Spy
Check if a method is called
const spy = sinon.spy(object, 'method') ... spy.restore() // remove spy expect(spy.callCount).to.be.eql(n) // check if the method is call n times
development:testing:sinonjs:start
This is an old revision of the document!
Check if a method is called
const spy = sinon.spy(object, 'method') ... spy.restore() // remove spy expect(spy.callCount).to.be.eql(n) // check if the method is call n times