Sinon.JS Assertions for Chai

Sinon–Chai provides a set of custom assertions for using the Sinon.JS spy, stub, and mocking framework with the
Chai assertion library. You get all the benefits of Chai with all the powerful tools of Sinon.JS.

Instead of using Sinon.JS’s assertions:

sinon.assert.calledWith(mySpy,"foo");

or awkwardly trying to use Chai’s should or expect interfaces on spy properties:

AMD

Sinon–Chai supports being used as an AMD module, registering itself anonymously (just like Chai). So, assuming you
have configured your loader to map the Chai and Sinon–Chai files to the respective module IDs "chai" and
"sinon-chai", you can use them as follows:

<script> tag

If you include Sinon–Chai directly with a <script> tag, after the one for Chai itself, then it will automatically plug
in to Chai and be ready for use. Note that you’ll want to get the latest browser build of Sinon.JS as well: