{
  "name": "sinon-chai",
  "description": "Extends Chai with assertions for the Sinon.JS mocking framework.",
  "keywords": [
    "sinon",
    "chai",
    "testing",
    "spies",
    "stubs",
    "mocks"
  ],
  "version": "2.5.0",
  "author": {
    "name": "Domenic Denicola",
    "email": "domenic@domenicdenicola.com",
    "url": "http://domenic.me"
  },
  "license": "WTFPL",
  "repository": {
    "type": "git",
    "url": "git://github.com/domenic/sinon-chai.git"
  },
  "bugs": {
    "url": "http://github.com/domenic/sinon-chai/issues"
  },
  "main": "./lib/sinon-chai.js",
  "scripts": {
    "test": "mocha",
    "lint": "jshint ./lib",
    "cover": "cover run node_modules/mocha/bin/_mocha && cover report html && opener ./cover_html/index.html"
  },
  "peerDependencies": {
    "chai": ">=1.0.0 <2",
    "sinon": ">=1.4.0 <2"
  },
  "devDependencies": {
    "chai": "~1.8",
    "coffee-script": "~1.6",
    "cover": "~0.2.9",
    "jshint": "~2.4",
    "mocha": "~1.17",
    "opener": "~1.3",
    "sinon": "~1.7"
  },
  "readme": "# Sinon.JS Assertions for Chai\n\n**Sinon–Chai** provides a set of custom assertions for using the [Sinon.JS][] spy, stub, and mocking framework with the\n[Chai][] assertion library. You get all the benefits of Chai with all the powerful tools of Sinon.JS.\n\nInstead of using Sinon.JS's assertions:\n\n```javascript\nsinon.assertCalledWith(mySpy, \"foo\");\n```\n\nor awkwardly trying to use Chai's `should` or `expect` interfaces on spy properties:\n\n```javascript\nmySpy.calledWith(\"foo\").should.be.ok;\nexpect(mySpy.calledWith(\"foo\")).to.be.ok;\n```\n\nyou can say\n\n```javascript\nmySpy.should.have.been.calledWith(\"foo\");\n```\n\n\n## Assertions\n\nAll of your favorite Sinon.JS assertions made their way into Sinon–Chai. We show the `should` syntax here; the `expect`\nequivalent is also available.\n\n<table>\n    <thead>\n        <tr>\n            <th>Sinon.JS property/method</th>\n            <th>Sinon–Chai assertion</th>\n        </tr>\n    </thead>\n    <tbody>\n        <tr>\n            <td>called</td>\n            <td>spy.should.have.been.called</td>\n        </tr>\n        <tr>\n            <td>callCount</td>\n            <td>spy.should.have.callCount(n)</td>\n        </tr>\n        <tr>\n            <td>calledOnce</td>\n            <td>spy.should.have.been.calledOnce</td>\n        </tr>\n        <tr>\n            <td>calledTwice</td>\n            <td>spy.should.have.been.calledTwice</td>\n        </tr>\n        <tr>\n            <td>calledThrice</td>\n            <td>spy.should.have.been.calledThrice</td>\n        </tr>\n        <tr>\n            <td>calledBefore</td>\n            <td>spy1.should.have.been.calledBefore(spy2)</td>\n        </tr>\n        <tr>\n            <td>calledAfter</td>\n            <td>spy1.should.have.been.calledAfter(spy2)</td>\n        </tr>\n        <tr>\n            <td>calledWithNew</td>\n            <td>spy.should.have.been.calledWithNew</td>\n        </tr>\n        <tr>\n            <td>alwaysCalledWithNew</td>\n            <td>spy.should.always.have.been.calledWithNew</td>\n        </tr>\n        <tr>\n            <td>calledOn</td>\n            <td>spy.should.have.been.calledOn(context)</td>\n        </tr>\n        <tr>\n            <td>alwaysCalledOn</td>\n            <td>spy.should.always.have.been.calledOn(context)</td>\n        </tr>\n        <tr>\n            <td>calledWith</td>\n            <td>spy.should.have.been.calledWith(...args)</td>\n        </tr>\n        <tr>\n            <td>alwaysCalledWith</td>\n            <td>spy.should.always.have.been.calledWith(...args)</td>\n        </tr>\n        <tr>\n            <td>calledWithExactly</td>\n            <td>spy.should.have.been.calledWithExactly(...args)</td>\n        </tr>\n        <tr>\n            <td>alwaysCalledWithExactly</td>\n            <td>spy.should.always.have.been.calledWithExactly(...args)</td>\n        </tr>\n        <tr>\n            <td>calledWithMatch</td>\n            <td>spy.should.have.been.calledWithMatch(...args)</td>\n        </tr>\n        <tr>\n            <td>alwaysCalledWithMatch</td>\n            <td>spy.should.always.have.been.calledWithMatch(...args)</td>\n        </tr>\n        <tr>\n            <td>returned</td>\n            <td>spy.should.have.returned(returnVal)</td>\n        </tr>\n        <tr>\n            <td>alwaysReturned</td>\n            <td>spy.should.have.always.returned(returnVal)</td>\n        </tr>\n        <tr>\n            <td>threw</td>\n            <td>spy.should.have.thrown(errorObjOrErrorTypeStringOrNothing)</td>\n        </tr>\n        <tr>\n            <td>alwaysThrew</td>\n            <td>spy.should.have.always.thrown(errorObjOrErrorTypeStringOrNothing)</td>\n        </tr>\n    </tbody>\n</table>\n\nFor more information on the behavior of each assertion, see\n[the documentation for the corresponding spy methods][spymethods]. These of course work on not only spies, but\nindividual spy calls, stubs, and mocks as well.\n\n\n## Installation and Usage\n\n### Node\n\nDo an `npm install sinon-chai` to get up and running. Then:\n\n```javascript\nvar chai = require(\"chai\");\nvar sinonChai = require(\"sinon-chai\");\n\nchai.use(sinonChai);\n```\n\nYou can of course put this code in a common test fixture file; for an example using [Mocha][], see\n[the Sinon–Chai tests themselves][fixturedemo].\n\n### AMD\n\nSinon–Chai supports being used as an [AMD][] module, registering itself anonymously (just like Chai). So, assuming you\nhave configured your loader to map the Chai and Sinon–Chai files to the respective module IDs `\"chai\"` and\n`\"sinon-chai\"`, you can use them as follows:\n\n```javascript\ndefine(function (require, exports, module) {\n    var chai = require(\"chai\");\n    var sinonChai = require(\"sinon-chai\");\n\n    chai.use(sinonChai);\n});\n```\n\n### `<script>` tag\n\nIf you include Sinon–Chai directly with a `<script>` tag, after the one for Chai itself, then it will automatically plug\nin to Chai and be ready for use. Note that you'll want to get the latest browser build of Sinon.JS as well:\n\n```html\n<script src=\"chai.js\"></script>\n<script src=\"sinon-chai.js\"></script>\n<script src=\"sinon.js\"></script>\n```\n\n### Ruby on Rails\n\nThanks to [Cymen Vig][], there's now [a Ruby gem][] of Sinon–Chai that integrates it with the Rails asset pipeline!\n\n\n[Sinon.JS]: http://sinonjs.org/\n[Chai]: http://chaijs.com/\n[spymethods]: http://sinonjs.org/docs/#spies-api\n[Mocha]: http://visionmedia.github.com/mocha/\n[fixturedemo]: https://github.com/domenic/sinon-chai/tree/master/test/\n[AMD]: https://github.com/amdjs/amdjs-api/wiki/AMD\n[Cymen Vig]: https://github.com/cymen\n[a Ruby gem]: https://github.com/cymen/sinon-chai-rails\n",
  "readmeFilename": "README.md",
  "homepage": "https://github.com/domenic/sinon-chai",
  "_id": "sinon-chai@2.5.0",
  "_from": "sinon-chai@~2.5.0"
}
