{"dist":{"shasum":"61d55efe83e8469ff684ba8bf4fa73053375a3ed","tarball":"https://registry.npmjs.org/claire/-/claire-0.3.2.tgz","integrity":"sha512-vdUJE9jtPz3TM0UH6C7ZmOJE4KwpSrhWWj9hD4SubFXeqeIwIyxyIG+oeTr/UmvmPzRiMkfSFsT2+l7+kBpmtw==","signatures":[{"sig":"MEQCICV5kv72kSBe93uu7AId9TID1OmQKUIJRxkPdw9aCT7iAiAs1YPxTXNEt858/TCapWiD6CzjEj12tNB/gRJHtsNzpg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"main":"./lib/index.js","name":"claire","author":{"name":"Quildreen \"Sorella\" Motta","email":"quildreen@gmail.com"},"readme":"Claire\n======\n\n[![Build Status](https://travis-ci.org/killdream/claire.png)](https://travis-ci.org/killdream/claire)\n\nClaire is a random testing library for both property-based testing\n(QuickCheck-like) and random program generation (ScalaCheck command's\nlike), which allows you to express your code's behaviours and invariants\nin a clear way.\n\n### Platform support\n\nClaire should work neatly in all ES5 platforms. ES3 platforms (IE8-,\netc) can use [es5-shim][] to provide the fallbacks necessary.\n\nThings are frozen to ensure immutability, but legacy engines can do\nwithout, so `Object.freeze = function(a) { return a }` is okay.\n\n[![browser support](http://ci.testling.com/killdream/claire.png)](http://ci.testling.com/killdream/claire)\n\n\n### Example \n\nThese uses the Claire API to collect data about a test. To have something that\nmakes sense of the collected data and works out of the box for testing, check\nout [Claire for Mocha][claire-mocha].\n\n```js\nvar claire = require('claire')\nvar _      = claire.data\n\n// Simple universal quantifier\nvar concat_p = claire.forAll ( _.List(_.Int), _.List(_.Int) )\n                     .satisfy(function(xs, ys) {\n                                return xs.length + ys.length\n                                    == xs.concat(ys).length })\n\n// Checking returns a Report with meta-data about the tests.\nclaire.check(100, concat_p)\n// (Object <| Report) => { property: { invariant: [Function] }\n//                       , passed: [ { ok: true, labels: [], arguments: [Object] }, ... ]\n//                       , failed: []\n//                       , ignored: []\n//                       , all: [ { ok: true, labels: [], arguments: [Object] }, ... ]\n//                       , labels: {}\n//                       , veredict: 'passed' }\n\n\n// Conditional properties\nvar sqrt_p = claire.forAll ( _.Int )\n                   .given  (function(n){ return n > 0 })\n                   .satisfy(function(n){ return Math.sqrt(n * n) == n })\n\n// The report can be made human-readable by just calling `.toString()'\nclaire.check(100, sqrt_p).toString()\n// (String) => \"+ OK passed 100 tests. 129 (56%) tests ignored.\"\n\n\n// Data classifiers\nvar reverse_p = claire.forAll ( _.List(_.Int), _.List(_.Int) )\n                      .satisfy(function(xs, ys) {\n                                 (reverse(xs.concat(ys)) + '')\n                                 == (reverse(ys).concat(reverse(xs)) + '') })\n                      .classify(function(xs, ys) {\n                                  return xs.length == 0? 'trivial'\n                                       : ys.length == 0? 'trivial'\n                                       : /* otherwise */ 'ok' })\n                                       \nclaire.check(100, reverse_p).toString()\n// (String) => \"+ OK passed 100 tests. \n//              > Collected test data:\n//                  o 85% - ok\n//                  o 15% - trivial\"\n```\n\n\n### Installing\n\nJust grab it from NPM:\n\n```js\nnpm install claire\n```\n\n\n### Documentation\n\nA reference of the API can be built using [Calliope][]:\n\n```js\n$ npm install -g calliope\n$ calliope build\n```\n\nA fully narrated documentation explaining the concepts behind the\nlibrary is planned for a future release.\n\n\n### Tests\n\nYou can run all tests using Mocha:\n\n```js\n$ npm test\n```\n\n\n### Licence\n\nMIT/X11. ie.: do whatever you want.\n\n\n[claire-mocha]: http://github.com/killdream/claire-mocha.git\n[Calliope]: http://github.com/killdream/calliope.git\n[es5-shim]: https://github.com/kriskowal/es5-shim\n","license":"MIT","scripts":{"test":"./node_modules/.bin/mocha lib-test/*.js","pretest":"npm run-script test-cc","test-cc":"./node_modules/.bin/lsc -o lib-test -c test/*.ls && ./node_modules/.bin/lsc -o lib -c src/*.ls","prepublish":"./node_modules/.bin/lsc -o lib -c src/*.ls","pretest-browser":"npm run-script test-cc && ./node_modules/.bin/browserify -o test/browser/suite-bundle.js -e test/browser/suite.js"},"_npmUser":{"name":"killdream","email":"quildreen@gmail.com"},"calliope":{"output":"docs/api","packages":[{"files":["src/*.ls"]}],"copyright":"© 2013 Quildreen \"Sorella\" Motta"},"keywords":["testing","test","property-based testing","random testing","quickcheck"],"testling":{"files":"test/browser/suite.js","harness":"mocha","browsers":{"ie":[6,7,8,9,10],"opera":[10,12,"next"],"chrome":[21,22,"canary"],"safari":[5.1],"firefox":[15,"nightly"]},"preprocess":"npm run-script pretest-browser"},"repository":{"url":"git://github.com/killdream/claire.git","type":"git"},"_npmVersion":"1.1.69","description":"Property-based testing library (à lá QuickCheck/ScalaCheck).","directories":{"doc":"docs"},"maintainers":[{"name":"killdream","email":"quildreen@gmail.com"}],"dependencies":{"boo":"~1.2.4","flaw":"~0.1.0","prelude-ls":"~0.6.0"},"readmeFilename":"README.md","devDependencies":{"mocha":"~1.8.1","es5-shim":"~2.0.5","LiveScript":"~1.1.1","browserify":"~2.4.3"},"_id":"claire@0.3.2","version":"0.3.2"}