javascriptunit-testingsinon

How can I test sequence of function calls by Sinon.js?


How can I test sequence of function calls by Sinon.js?

For example i have three (3) handlers in object, and want define sequence of handler calls. Is there any possibilities for this?


Solution

  • http://sinonjs.org/docs/

    sinon.assert.callOrder(spy1, spy2, ...)

    Passes if the provided spies where called in the specified order.