{"name":"co-mocha","version":"1.2.2","description":"Enable support for generators in Mocha tests","main":"lib/co-mocha.js","files":["co-mocha.js","lib/","LICENSE"],"scripts":{"lint":"standard","build":"browserify lib/co-mocha.js -s co-mocha -o co-mocha.js","test-spec":"mocha --harmony -R spec --require lib/co-mocha.js --bail","test-cov":"testem ci -l Firefox,Node","test":"mocha -V && npm run lint && npm run build && npm run test-cov"},"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":{"browserify":"^14.0.0","chai":"^4.0.1","es6-promise":"^4.0.5","istanbul":"^1.1.0-alpha.1","mocha":"*","regenerator":"^0.10.0","standard":"^10.0.0","testem":"^1.13.0","traceur":"0.0.111"},"standard":{"ignore":["coverage/**","node_modules/**","bower_components/**","co-mocha.js"]},"dependencies":{"co":"^4.0.0","is-generator":"^1.0.1"},"peerDependencies":{"mocha":">=1.18 <6"},"gitHead":"10ddfea56aa3215b4408737fd06a9ee5c3d9aabb","_id":"co-mocha@1.2.2","_npmVersion":"5.6.0","_nodeVersion":"9.6.1","_npmUser":{"name":"blakeembrey","email":"hello@blakeembrey.com"},"dist":{"integrity":"sha512-ocdJRn3sxonOqpdjSU2VwTwWzjTSoatzsTqCWiC3eGvJFNs8ZNMlZwfgYolQCdfddMz4muiZl99KIV9gKoNvxg==","shasum":"c4fdf24d37f43ca4da668b14542a96e9377479ab","tarball":"http://registry-npm.ywwl.com/co-mocha/download/co-mocha-1.2.2.tgz","fileCount":6,"unpackedSize":18020,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCYl4Vi1qMXy+SEW++lWvj4Iq+KiZYy5RavNKOlsWp71AIhANYGYfb6slmT2GzaE/ZxCkwmROShx8fC86RWDVya0CIh"}],"size":6010,"noattachment":false,"key":"/co-mocha/-/co-mocha-1.2.2.tgz"},"maintainers":[{"name":"blakeembrey","email":"hello@blakeembrey.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/co-mocha_1.2.2_1519709083328_0.7379975609822167"},"_hasShrinkwrap":false,"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":1519709083555,"_cnpm_publish_time":1519709083555,"dist-tags":{"latest":"1.2.2"}}