{"name":"trap","version":"0.1.0","description":"A simpler way to test your code.","main":"index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"https://github.com/danielmoore/trap.git"},"author":{"name":"Daniel Moore"},"keywords":["tap","test","harness"],"licenses":[{"type":"MIT","url":"http://www.opensource.org/licenses/mit-license.php"}],"devDependencies":{"tape":"~0.1.5","proxyquire":"~0.4.0"},"dependencies":{"colors":"~0.6.0-1"},"readme":"# trap\n\ntrap is simply the most dead-simple test framework you can pick up. It builds and simplifies\nthe already simple structure of of `node-tap` or `tape`, but is extensible like `mocha`.\n\n## What do I need to know?\n\nTwo things: `test`, and `t.cb`. It's really that simple. You can use the assertion framework\nyou already know. By default trap uses the standard node assertion library. To run the tests in\nsingle file, just `node` the file.\n\n### `test`\n\nLike tap, we make new test blocks with the `test` function.\n\n```javascript\nvar test = require('trap').test;\n\ntest('This is a test block!', function (t) {\n  t.test('This is a child test block!', function (t) {\n    // continue to your heart's content.\n  });\n});\n```\n\n### `t.cb`\n\nUnlike tap, you don't need to figure out when your async tests are done runnning, nor\ndo you need to count how many assertions you have and plan them. Instead, simply register\nall of your callbacks with `t.cb`.\n\n```javascript\nvar test = require('trap').test;\n\ntest('Async stuff', function (t) {\n  setTimeout(t.cb(function() {\n    t.ok(true, 'This is still part of the \"Async stuff\" test!');\n  }), 100);\n});\n```\n\n### Assertions\n\nTo get the maximum prettiness and documentation of trap, customize\n`config.createAssertionWrapper` to wrap your favorite assertion library. Otherwise\nyou can just throw exceptions like you normally do, and those will be interpreted as\nassertion failures. Hopefully soon we can get plugins for all the major assertion\nlibraries so this will be even easier.\n\n## Examples\n\nCheck out the examples folder.","readmeFilename":"README.md","_id":"trap@0.1.0","dist":{"shasum":"839f983e19e72a5a39340fcdc4937c784d1c8b85","tarball":"http://registry-npm.ywwl.com/trap/download/trap-0.1.0.tgz","integrity":"sha512-iq1fpAej/2+zk0AYvIXTvHQD8a79Fc4hvKrz+sKzWcGCpr4jX02eD3EAH8FtLITs7Gfl9+srOzCUaIFqiTkY+g==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCJUbINwZkCbTxQipkgQS7inF5kjWow1CTqoeSRivm78AIhAMVhApIWtZhQpVr55hLuquzMc+NA5zKdUKFcbNnN4iyn"}],"size":6651,"noattachment":false,"key":"/trap/-/trap-0.1.0.tgz"},"_npmVersion":"1.1.66","_npmUser":{"name":"danielmoore","email":"polaris@northhorizon.net"},"maintainers":[{"name":"danielmoore","email":"polaris@northhorizon.net"}],"directories":{},"publish_time":1358261269572,"_cnpm_publish_time":1358261269572,"dist-tags":{"latest":"0.4.2"}}