{"name":"claire","version":"0.3.2","description":"Property-based testing library (à lá QuickCheck/ScalaCheck).","main":"./lib/index.js","directories":{"doc":"docs"},"dependencies":{"boo":"~1.2.4","prelude-ls":"~0.6.0","flaw":"~0.1.0"},"devDependencies":{"LiveScript":"~1.1.1","mocha":"~1.8.1","es5-shim":"~2.0.5","browserify":"~2.4.3"},"scripts":{"test-cc":"./node_modules/.bin/lsc -o lib-test -c test/*.ls && ./node_modules/.bin/lsc -o lib -c src/*.ls","test":"./node_modules/.bin/mocha lib-test/*.js","pretest-browser":"npm run-script test-cc && ./node_modules/.bin/browserify -o test/browser/suite-bundle.js -e test/browser/suite.js","pretest":"npm run-script test-cc","prepublish":"./node_modules/.bin/lsc -o lib -c src/*.ls"},"repository":{"type":"git","url":"git://github.com/killdream/claire.git"},"keywords":["testing","test","property-based testing","random testing","quickcheck"],"author":{"name":"Quildreen \"Sorella\" Motta","email":"quildreen@gmail.com"},"license":"MIT","readmeFilename":"README.md","calliope":{"output":"docs/api","copyright":"© 2013 Quildreen \"Sorella\" Motta","packages":[{"files":["src/*.ls"]}]},"testling":{"files":"test/browser/suite.js","preprocess":"npm run-script pretest-browser","browsers":{"ie":[6,7,8,9,10],"firefox":[15,"nightly"],"chrome":[21,22,"canary"],"opera":[10,12,"next"],"safari":[5.1]},"harness":"mocha"},"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","_id":"claire@0.3.2","dist":{"shasum":"61d55efe83e8469ff684ba8bf4fa73053375a3ed","tarball":"http://registry-npm.ywwl.com/claire/download/claire-0.3.2.tgz","integrity":"sha512-vdUJE9jtPz3TM0UH6C7ZmOJE4KwpSrhWWj9hD4SubFXeqeIwIyxyIG+oeTr/UmvmPzRiMkfSFsT2+l7+kBpmtw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICV5kv72kSBe93uu7AId9TID1OmQKUIJRxkPdw9aCT7iAiAs1YPxTXNEt858/TCapWiD6CzjEj12tNB/gRJHtsNzpg=="}],"size":446325,"noattachment":false,"key":"/claire/-/claire-0.3.2.tgz"},"_npmVersion":"1.1.69","_npmUser":{"name":"killdream","email":"quildreen@gmail.com"},"maintainers":[{"name":"killdream","email":"quildreen@gmail.com"}],"publish_time":1363827299375,"_cnpm_publish_time":1363827299375,"dist-tags":{"latest":"0.4.1"}}