development:testing:sinonjs:start

This is an old revision of the document!


Sinon JS

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.1547354212.txt.gz
  • Last modified: 2019/01/13 12:36
  • by don.lee