{"name":"thunk-mocha","version":"1.0.1","description":"Enable support for generators in Mocha with backward compatibility.","main":"index.js","authors":["Yan Qing <admin@zensh.com>"],"scripts":{"test":"standard && mocha -r ./index"},"repository":{"type":"git","url":"git://github.com/thunks/thunk-mocha.git"},"keywords":["mocha","thunk","generator"],"engines":{"node":">= 1.x.x"},"dependencies":{"thunks":"^4.1.0"},"devDependencies":{"mocha":"^2.3.4","standard":"^5.4.1"},"license":"MIT","bugs":{"url":"https://github.com/thunks/thunk-mocha/issues"},"homepage":"https://github.com/thunks/thunk-mocha","ignore":["**/.*","node_modules","test","gulpfile.js"],"gitHead":"8a67295c90648fb6f55dbd7556ffc2be632ea4c6","_id":"thunk-mocha@1.0.1","_shasum":"bb932b7a1c445b990e0e6a431fea87a18a9cca16","_from":".","_npmVersion":"2.14.7","_nodeVersion":"4.2.2","_npmUser":{"name":"zensh","email":"admin@zensh.com"},"maintainers":[{"name":"zensh","email":"admin@zensh.com"}],"dist":{"shasum":"bb932b7a1c445b990e0e6a431fea87a18a9cca16","tarball":"http://registry-npm.ywwl.com/thunk-mocha/download/thunk-mocha-1.0.1.tgz","integrity":"sha512-WkyGHiXR0xBuU05Aj46S30RseRe8dsGDm2KNlf6c+xqRFbLbKKF9TLBYT5uELa2T419GAgaQJCDO7mMz4SK2YQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICaNlDAl3Ckg8vGU1OxwANdgbBlAZdb4IoWgScCdzRZcAiEAvjSm2Z7J/5V9ywP8MOIk+/22yM7J/B2jgePsnR95XSU="}],"size":2999,"noattachment":false,"key":"/thunk-mocha/-/thunk-mocha-1.0.1.tgz"},"directories":{},"readme":"thunk-mocha\n==========\nEnable support for generators in Mocha with backward compatibility.\n\n[![NPM version][npm-image]][npm-url]\n[![Build Status][travis-image]][travis-url]\n[![Downloads][downloads-image]][downloads-url]\n\nIt is similar to [Co Mocha](https://github.com/blakeembrey/co-mocha), but it is a different implementation and more powerful. It is a perfect patch for mocha!\n\n## Installation\n\n```\nnpm install thunk-mocha\n```\n\n## Usage\n\n**Call by mocha in CLI:**\n\n```sh\nmocha -r thunk-mocha\n```\n\n**Call in js file:**\n\n```js\n// make sure that `mocha` have loaded\nrequire('thunk-mocha')()\n// or: require('thunk-mocha')(require('mocha'))\n```\n\n\n## Example\n\n**After patched, mocha support:**\n```js\nit('support sync test', function () {\n  // do some test\n})\n\nit('support thunk style async test', function (done) {\n  // do some test\n  done()\n})\n\nit('support promise style async test', function () {\n  // do some test\n  return promiseLikeObject\n})\n\nit('support generator style async test', function * () {\n  // do some test\n  yield promise\n  // yield thunk\n  // yield generator\n  // ...\n})\n\nit('support async/await style async test', async function () {\n  // do some test\n  await promise\n})\n\nit('support Rx.Observable style async test', function () {\n  // do some test\n  return Rx.Observable.bindNodeCallback(fs.stat)('package.json')\n})\n```\n\n[npm-url]: https://npmjs.org/package/thunk-mocha\n[npm-image]: http://img.shields.io/npm/v/thunk-mocha.svg\n\n[travis-url]: https://travis-ci.org/thunks/thunk-mocha\n[travis-image]: http://img.shields.io/travis/thunks/thunk-mocha.svg\n\n[downloads-url]: https://npmjs.org/package/thunk-mocha\n[downloads-image]: http://img.shields.io/npm/dm/thunk-mocha.svg?style=flat-square\n","publish_time":1448766476157,"_cnpm_publish_time":1448766476157,"dist-tags":{"latest":"1.0.8"}}