{"_id":"chai-checkmark","_rev":"4652325","name":"chai-checkmark","description":"A Chai plugin for counting assertions.","dist-tags":{"latest":"1.0.1"},"maintainers":[{"name":"sirlancelot","email":""}],"time":{"modified":"2026-04-10T20:45:26.000Z","created":"2014-12-02T23:19:22.011Z","1.0.1":"2014-12-18T22:54:54.620Z","1.0.0":"2014-12-02T23:19:22.011Z"},"users":{},"author":{"name":"Matthew Pietz"},"repository":{"type":"git","url":"git://github.com/sirlancelot/chai-checkmark"},"versions":{"1.0.1":{"name":"chai-checkmark","version":"1.0.1","description":"A Chai plugin for counting assertions.","main":"chai-checkmark.js","scripts":{"test":"mocha","lint":"jshint --exclude node_modules/ ./"},"repository":{"type":"git","url":"git://github.com/sirlancelot/chai-checkmark"},"keywords":["chai","chai-plugin"],"author":{"name":"Matthew Pietz"},"license":"ISC","bugs":{"url":"https://github.com/sirlancelot/chai-checkmark/issues"},"homepage":"https://github.com/sirlancelot/chai-checkmark","devDependencies":{"chai":"^1.10.0","jshint":"^2.5.11","mocha":"^2.0.1"},"gitHead":"647354066a06df0bac6af588feba49af461ff2f5","_id":"chai-checkmark@1.0.1","_shasum":"9fbb3c9ad9101f097ef288328d30f4227d74fffb","_from":".","_npmVersion":"1.4.28","_npmUser":{"name":"sirlancelot","email":"sirlancelot@gmail.com"},"maintainers":[{"name":"sirlancelot","email":""}],"dist":{"shasum":"9fbb3c9ad9101f097ef288328d30f4227d74fffb","size":3887,"noattachment":false,"key":"/chai-checkmark/-/chai-checkmark-1.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/chai-checkmark/download/chai-checkmark-1.0.1.tgz"},"directories":{},"publish_time":1418943294620,"_hasShrinkwrap":false,"_cnpm_publish_time":1418943294620,"_cnpmcore_publish_time":"2021-12-16T18:49:00.993Z"},"1.0.0":{"name":"chai-checkmark","version":"1.0.0","description":"A Chai plugin for counting assertions.","main":"chai-checkmark.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1","lint":"jshint --exclude node_modules/ ./"},"repository":{"type":"git","url":"git://github.com/sirlancelot/chai-checkmark"},"keywords":["chai","chai-plugin"],"author":{"name":"Matthew Pietz"},"license":"ISC","bugs":{"url":"https://github.com/sirlancelot/chai-checkmark/issues"},"homepage":"https://github.com/sirlancelot/chai-checkmark","devDependencies":{"jshint":"^2.5.10"},"gitHead":"a33dde3573cc0a8c07e2f5f127ae4bb02d646a4d","_id":"chai-checkmark@1.0.0","_shasum":"18775c58436d7caf0a37a497326ce2e1c41b0f29","_from":".","_npmVersion":"1.4.28","_npmUser":{"name":"sirlancelot","email":"sirlancelot@gmail.com"},"maintainers":[{"name":"sirlancelot","email":""}],"dist":{"shasum":"18775c58436d7caf0a37a497326ce2e1c41b0f29","size":3042,"noattachment":false,"key":"/chai-checkmark/-/chai-checkmark-1.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/chai-checkmark/download/chai-checkmark-1.0.0.tgz"},"directories":{},"publish_time":1417562362011,"_hasShrinkwrap":false,"_cnpm_publish_time":1417562362011,"_cnpmcore_publish_time":"2021-12-16T18:49:01.278Z"}},"readme":"# Chai Checkmark [![][ci-develop]][travis-ci] [![][downloads]][npm]\n\n**Checkmark** is a [Chai][] plugin for counting assertions made during a test.\nOften, when dealing with asynchronous tests, it can be difficult to determine\nif a callback was actually called. With Checkmark, you can be assured that the\nassertion was made.\n\n## Installation\n\nInclude Checkmark in the browser, as a CommonJS module, or through AMD.\n\n```html\n<!-- Browser -->\n<script src=\"chai.js\"></script>\n<script src=\"chai-checkmark.js\"></script>\n```\n```js\n// CommonJS\nvar chai = require(\"chai\"),\n    plugin = require(\"chai-checkmark\")\nchai.use(plugin)\n```\n```js\n// AMD\nrequire([\"chai\", \"chai-checkmark\"], function(chai, plugin) {\n    chai.use(plugin)\n})\n```\n\n## How to use\n\n```js\ndescribe(\"something\", function() {\n  it(\"should check two things\", function(next) {\n    expect(2).checks(next) // <-- pass in the callback\n\n    \"sync test\".should.be.a(\"string\").mark() // <-- check 1\n\n    setTimeout(function() {\n      // check 2, callback is called after the current event finishes\n      \"async test\".should.be.a(\"string\").mark()\n    }, 500)\n  })\n})\n```\n\n## API\n\nCheckmark builds on Chai's assertion library by adding just two methods:\n\n### `expect(Number).check(Function)` or `.checks(Function)`\n\nThis must be called before `.mark()` but doesn't have to be at the very\nbeginning of a test. You establish how many times you expect `.mark()` to\nbe called and optionally pass in a callback to be called when the number\nof marks is reached.\n\n### `expect(str).to.be.a(\"string\").mark()`\n\nAdd `.mark()` to the end of every assertion to which you want to have\ntracked by Checkmark. You can use any number of Chai's assertions,\nincluding `.and`, as long as you end your statement with `.mark()`.\n\n## Contributing\n\nPull Requests are welcome. They will only be merged if they are based off the\ntip of the [develop][] branch. Please rebase (don't merge!) your changes if\nyou are behind. To learn about why rebase is better than merge, check out [The\nCase for Git Rebase][rebase].\n\nIn short, to bring your Working Copy up to the tip of [develop][], you can use\nthe rebase feature: `git pull --rebase`. See [Pull with Rebase][pull] for\ndetails.\n\n  [Chai]: http://chaijs.com/\n  [ci-develop]: https://img.shields.io/travis/sirlancelot/chai-checkmark/develop.svg?style=flat-square\n  [ci-master]: https://img.shields.io/travis/sirlancelot/chai-checkmark/master.svg?style=flat-square\n  [develop]: https://github.com/sirlancelot/chai-checkmark/tree/develop\n  [downloads]: https://img.shields.io/npm/dm/chai-checkmark.svg?style=flat-square\n  [npm]: https://www.npmjs.org/package/chai-checkmark\n  [pull]: http://gitready.com/advanced/2009/02/11/pull-with-rebase.html\n  [rebase]: http://darwinweb.net/articles/the-case-for-git-rebase\n  [travis-ci]: https://travis-ci.org/sirlancelot/chai-checkmark\n","_attachments":{},"homepage":"https://github.com/sirlancelot/chai-checkmark","bugs":{"url":"https://github.com/sirlancelot/chai-checkmark/issues"},"license":"ISC"}