{"name":"co-mocha","version":"1.1.0","description":"Enable support for generators in Mocha tests","main":"co-mocha.js","scripts":{"test":"node --harmony-generators node_modules/.bin/istanbul cover _mocha -- -R spec"},"repository":{"type":"git","url":"git://github.com/blakeembrey/co-mocha.git"},"keywords":["co","mocha","harmony","generators"],"author":{"name":"Blake Embrey","email":"hello@blakeembrey.com","url":"http://blakeembrey.me"},"license":"MIT","bugs":{"url":"https://github.com/blakeembrey/co-mocha/issues"},"homepage":"https://github.com/blakeembrey/co-mocha","devDependencies":{"bluebird":"^2.3.2","istanbul":"git://github.com/gotwarlost/istanbul#harmony","mocha":"^1.18.2","regenerator":"^0.4.12","traceur":"0.0.58"},"dependencies":{"co":"^4.0.0","is-generator":"^1.0.0"},"peerDependencies":{"mocha":">=1.18 <3"},"gitHead":"37bf86c6a18d460a05de097af33209d040161a25","_id":"co-mocha@1.1.0","_shasum":"d6a965416254049cb4bce84a2de4b99cdb159e77","_from":".","_npmVersion":"2.0.0","_npmUser":{"name":"blakeembrey","email":"hello@blakeembrey.com"},"maintainers":[{"name":"blakeembrey","email":"hello@blakeembrey.com"}],"dist":{"shasum":"d6a965416254049cb4bce84a2de4b99cdb159e77","tarball":"http://registry-npm.ywwl.com/co-mocha/download/co-mocha-1.1.0.tgz","integrity":"sha512-ALM6/VqMXNqUIT4LPzfOVsgN8Tw9bXoYLIrqK1o/LpuMqZXQjFtkm3d3uDfOhXQjE192SvXsJmcS3+qqUnZ8vg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFliVAedaZywPyG59X/pk3JaXPzY5qUxsN6cMZX0hH7MAiB8Uq2I5wgVp533N8BTfVxuU9M7YzapRfuIpZp+8Pm6bA=="}],"size":3572,"noattachment":false,"key":"/co-mocha/-/co-mocha-1.1.0.tgz"},"directories":{},"readme":"# Co Mocha\n\n[![NPM version][npm-image]][npm-url]\n[![NPM downloads][downloads-image]][downloads-url]\n[![Build status][travis-image]][travis-url]\n[![Test coverage][coveralls-image]][coveralls-url]\n[![Greenkeeper badge](https://badges.greenkeeper.io/blakeembrey/co-mocha.svg)](https://greenkeeper.io/)\n\nEnable support for generators in Mocha tests using [co](https://github.com/visionmedia/co).\n\nUse the `--harmony-generators` flag when running node 0.11.x to access generator functions, or transpile your tests using [traceur](https://github.com/google/traceur-compiler) or [regenerator](https://github.com/facebook/regenerator).\n\n## Installation\n\n```\nnpm install co-mocha --save-dev\n```\n\n## Usage\n\nJust require the module in your tests and start writing generators in your tests.\n\n```js\nit('should do something', function * () {\n  yield users.load(123)\n})\n```\n\n### Node\n\nInstall the module using `npm install co-mocha --save-dev`. Now just require the module to automatically monkey patch any available `mocha` instances. With `mocha`, you have multiple ways of requiring the module - add `--require co-mocha` to your `mocha.opts` or add `require('co-mocha')` inside your main test file.\n\nIf you need to monkey patch a different mocha instance you can use the library directly:\n\n```js\nvar mocha = require('mocha')\nvar coMocha = require('co-mocha')\n\ncoMocha(mocha)\n```\n\n### `<script>` Tag\n\n```html\n<script src=\"co-mocha.js\"></script>\n```\n\nIncluding the browserified script will automatically patch `window.Mocha`. Just make sure you include it after `mocha.js`. If that is not possible the library exposes `window.coMocha`, which can be used (`window.coMocha(window.Mocha)`).\n\n### AMD\n\nSame details as the script, but using AMD requires instead.\n\n## How It Works\n\nThe module monkey patches the `Runnable.prototype.run` method of `mocha` to enable generators. In contrast to other npm packages, `co-mocha` extends `mocha` at runtime - allowing you to use any compatible mocha version.\n\n## License\n\nMIT\n\n[npm-image]: https://img.shields.io/npm/v/co-mocha.svg?style=flat\n[npm-url]: https://npmjs.org/package/co-mocha\n[downloads-image]: https://img.shields.io/npm/dm/co-mocha.svg?style=flat\n[downloads-url]: https://npmjs.org/package/co-mocha\n[travis-image]: https://img.shields.io/travis/blakeembrey/co-mocha.svg?style=flat\n[travis-url]: https://travis-ci.org/blakeembrey/co-mocha\n[coveralls-image]: https://img.shields.io/coveralls/blakeembrey/co-mocha.svg?style=flat\n[coveralls-url]: https://coveralls.io/r/blakeembrey/co-mocha?branch=master\n","publish_time":1416238866991,"_cnpm_publish_time":1416238866991,"dist-tags":{"latest":"1.2.2"}}