{"_id":"sink-test","_rev":"28-8026d44820b92af641623aac9df4716d","name":"sink-test","description":"Headless / Browser JavaScript Unit Tester","dist-tags":{"latest":"1.0.2"},"versions":{"0.0.3":{"name":"sink-test","description":"test your javascript - headless, or in the browser","version":"0.0.3","authors":["Dustin Diaz <@ded>","Jacob Thornton <@fat>"],"keywords":["testing","unit tests","headless","boosh","luke warm"],"main":"./src/sink.js","engines":{"node":">= 0.1.0"},"_id":"sink-test@0.0.3","_engineSupported":true,"_npmVersion":"0.3.14","_nodeVersion":"v0.4.1","directories":{},"files":[""],"_defaultsLoaded":true,"dist":{"shasum":"9a3b0cdbe804de78b35c9a22d7396e86ddf9c3be","tarball":"https://registry.npmjs.org/sink-test/-/sink-test-0.0.3.tgz","integrity":"sha512-BehhRiT/ttqXhtOlmyhX9IWI3fDXZqIy+1+yUimkAd6ggZ8lfDkd+jMNmwVCOBrtJ8sC5i067cJj0i8NFb7FAQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGTAFg90iU5HaH7jpg5ZOBF/MFrfForikyRDZXCJEmgCAiAyLqZgl2uQq9p1CX7OMepqtGTRPI2UM5FUQVjgVNSM5Q=="}]}},"0.0.4":{"name":"sink-test","description":"test your javascript - headless, or in the browser","version":"0.0.4","authors":["Dustin Diaz <@ded>","Jacob Thornton <@fat>"],"keywords":["testing","unit tests","headless","boosh","luke warm"],"main":"./src/sink.js","engines":{"node":">= 0.1.0"},"_id":"sink-test@0.0.4","_engineSupported":true,"_npmVersion":"0.3.14","_nodeVersion":"v0.4.1","directories":{},"files":[""],"_defaultsLoaded":true,"dist":{"shasum":"973535ad0fd6172dbdbc285c55c0690a938716e3","tarball":"https://registry.npmjs.org/sink-test/-/sink-test-0.0.4.tgz","integrity":"sha512-MZwO8sldtdL2NHSrfRkgl+7cSJzh/dKBd/Jk7IE8smKhXw4xHt/cSMZv8iddslLsSCg0MVv3HNCMUzg9C0yrSA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIA08N4780e4iK5GJzQwxT1tCpKUXvUzEmLW7rrUgkcYlAiEA7KI+wrcDIbln/Mq0MdLvuT2RJS81IriLr3G3LcAX2rM="}]}},"0.0.5":{"name":"sink-test","description":"test your javascript - headless, or in the browser","version":"0.0.5","authors":["Dustin Diaz <@ded>","Jacob Thornton <@fat>"],"keywords":["testing","unit tests","headless","boosh","luke warm"],"main":"./src/sink.js","engines":{"node":">= 0.1.0"},"dependencies":{},"devDependencies":{},"_id":"sink-test@0.0.5","_engineSupported":true,"_npmVersion":"1.0.3","_nodeVersion":"v0.5.0-pre","_defaultsLoaded":true,"dist":{"shasum":"e47cb2f06039aaec6a094fd9083f153dc3b4cdd4","tarball":"https://registry.npmjs.org/sink-test/-/sink-test-0.0.5.tgz","integrity":"sha512-mZADXC7Q2Zuxn57m3d64AXrrXV4tq6+So4R4oSRpgO0yhzuG1IgmBt7ceWEPTnVRrOHCeE2FMeNg0QuuhT+Qtw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICUW6swomy5tSEDCKvJguEWsYQP+I/FC43C1v40aEjxwAiEAlZWt/nSyYvi0edDYzciKLx0NzV+xEpl4HlvR/0YNYmE="}]},"scripts":{}},"0.0.6":{"name":"sink-test","description":"test your javascript - headless, or in the browser","version":"0.0.6","authors":["Dustin Diaz <@ded>","Jacob Thornton <@fat>"],"keywords":["testing","unit tests","headless","boosh","luke warm"],"main":"./src/sink.js","engines":{"node":">= 0.1.0"},"dependencies":{"colors":">= 0.5.0"},"devDependencies":{},"_id":"sink-test@0.0.6","_engineSupported":true,"_npmVersion":"1.0.6","_nodeVersion":"v0.5.0-pre","_defaultsLoaded":true,"dist":{"shasum":"eec2ef230eeb28f3e74da8745f73015fd67ab84f","tarball":"https://registry.npmjs.org/sink-test/-/sink-test-0.0.6.tgz","integrity":"sha512-9Fy2FCAnMBInakQ2aVVhytjD6S7LanQwE6LjCtvAnC2r1O4jvGz0D706+uuAcgQWhv9eKUt6NcwuxkhT8DpOPw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDwwDxpY+DT9vOqyTCyeEpSff2rYL6gjKB0eHdl4Yo9dQIgfbRP69j8pIHaMFqwGbPhsThjDKPSxWeG2sN9yEzl3kc="}]},"scripts":{}},"0.0.7":{"name":"sink-test","description":"test your javascript - headless, or in the browser","version":"0.0.7","authors":["Dustin Diaz <@ded>","Jacob Thornton <@fat>"],"keywords":["testing","unit tests","headless","boosh","luke warm"],"main":"./src/sink.js","engines":{"node":">= 0.1.0"},"dependencies":{"colors":">= 0.5.0"},"_npmJsonOpts":{"file":"/Users/jacob/.npm/sink-test/0.0.7/package/package.json","wscript":false,"contributors":false,"serverjs":false},"_id":"sink-test@0.0.7","devDependencies":{},"_engineSupported":true,"_npmVersion":"1.0.13","_nodeVersion":"v0.4.8","_defaultsLoaded":true,"dist":{"shasum":"12244e24632cc1d9455c96a62b4daa69a1300d84","tarball":"https://registry.npmjs.org/sink-test/-/sink-test-0.0.7.tgz","integrity":"sha512-02romU1mHT5S5k3Ont4n+UBZ/ALjbNErBv+M7wbEuONUGNUZaZ2+44webJS9X4zLACzd91Tm9CJ3lA/EUuNCBw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBg7OZfxdp22z8/yOq23xHlTU4Qk+dsBTlxU0UeMjDVgAiBYsj+Ci4daqFvO82x/lGZQ0Si9NE24i6e94XUkxAnkaQ=="}]},"scripts":{}},"0.0.8":{"name":"sink-test","description":"test your javascript - headless, or in the browser","version":"0.0.8","authors":["Dustin Diaz <@ded>","Jacob Thornton <@fat>"],"keywords":["testing","unit tests","headless","boosh","luke warm"],"main":"./src/sink.js","engines":{"node":">= 0.1.0"},"dependencies":{"colors":">= 0.5.0"},"_npmJsonOpts":{"file":"/Users/jacob/.npm/sink-test/0.0.8/package/package.json","wscript":false,"contributors":false,"serverjs":false},"_id":"sink-test@0.0.8","devDependencies":{},"_engineSupported":true,"_npmVersion":"1.0.13","_nodeVersion":"v0.4.8","_defaultsLoaded":true,"dist":{"shasum":"705021636af0a61ddab74f6f1cd8f8c8d9c04dd8","tarball":"https://registry.npmjs.org/sink-test/-/sink-test-0.0.8.tgz","integrity":"sha512-w/ZwpdN0uCbDm/4LqsP40lv3pqcBGrPRkU/MeWZXGIb3EiOsvOQhhYX7S7HPODl+xz5B7RWgGPreX1O/+2PHSw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIERK6+Rjg0EeJdTGqTeLWwOC+ANH/T/1HKiOAMMVSuRHAiBNVqql60Op8aXbt072nmx3v1wPUuy5Ys/1U74M5AH/Tw=="}]},"scripts":{}},"0.0.9":{"name":"sink-test","description":"test your javascript - headless, or in the browser","version":"0.0.9","author":{"name":"Dustin Diaz","email":"polvero@gmail.com","url":"http://dustindiaz.com"},"keywords":["testing","unit tests","headless","tdd","async"],"main":"./src/sink.js","engines":{"node":">= 0.4.0"},"dependencies":{"colors":">= 0.5.0"},"_npmJsonOpts":{"file":"/Users/dustin/.npm/sink-test/0.0.9/package/package.json","wscript":false,"contributors":false,"serverjs":false},"_id":"sink-test@0.0.9","devDependencies":{},"_engineSupported":true,"_npmVersion":"1.0.27","_nodeVersion":"v0.4.11","_defaultsLoaded":true,"dist":{"shasum":"be5f1eaf2485069d1d851ecf289857898860d888","tarball":"https://registry.npmjs.org/sink-test/-/sink-test-0.0.9.tgz","integrity":"sha512-B46lZZMtnVdz8DPQrtADuCi2/Gy23CRykEHOzeHMJveJJ1f1ZwT0mIfZ3ZMUs53M03nbf/YJRA5m4SLQn+I4lg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDZiXoxKBMqP6qgD9ygxAYQx/rBhYIhga8U7qg3yvgGvAIhALZ81ERh7wgTtjxJZhyD3kE3vqhcYl+NWgkejtB8k6gr"}]},"maintainers":[{"name":"ded","email":"polvero@gmail.com"},{"name":"fat","email":"jacobthornton@gmail.com"}]},"0.1.0":{"name":"sink-test","description":"test your javascript - headless, or in the browser","version":"0.1.0","author":{"name":"Dustin Diaz","email":"polvero@gmail.com","url":"http://dustindiaz.com"},"keywords":["testing","unit tests","headless","tdd","async"],"main":"./src/sink.js","engines":{"node":">= 0.4.0"},"dependencies":{"colors":">= 0.5.0"},"_npmJsonOpts":{"file":"/Users/dustin/.npm/sink-test/0.1.0/package/package.json","wscript":false,"contributors":false,"serverjs":false},"_id":"sink-test@0.1.0","devDependencies":{},"_engineSupported":true,"_npmVersion":"1.0.27","_nodeVersion":"v0.4.11","_defaultsLoaded":true,"dist":{"shasum":"fac70922975c7de9745ec780d2796522ea38b71f","tarball":"https://registry.npmjs.org/sink-test/-/sink-test-0.1.0.tgz","integrity":"sha512-1oHM9P/f7sDfEuKk1EEqQDp8DsGlSRee/2VvyA+4bLxQRtQ/DJLMFUpLqNYCkvdUYtxtOtIHagc3/Jk+VEMbhw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC5j4zuIVl6PaeW+vMq93PM/GZmcHfH4SPG0R6dXj2M8gIhAO4QgrjcLMmcIh/iUzq+Zyxx1Vrpdsxz3iU4ArPfdx8N"}]},"maintainers":[{"name":"ded","email":"polvero@gmail.com"},{"name":"fat","email":"jacobthornton@gmail.com"}]},"0.1.1":{"name":"sink-test","description":"test your javascript - headless, or in the browser","version":"0.1.1","author":{"name":"Dustin Diaz","email":"polvero@gmail.com","url":"http://dustindiaz.com"},"keywords":["testing","unit tests","headless","tdd","async"],"main":"./src/sink.js","engines":{"node":">= 0.4.0"},"dependencies":{"colors":">= 0.5.0"},"_npmJsonOpts":{"file":"/Users/dustin/.npm/sink-test/0.1.1/package/package.json","wscript":false,"contributors":false,"serverjs":false},"_id":"sink-test@0.1.1","devDependencies":{},"_engineSupported":true,"_npmVersion":"1.0.27","_nodeVersion":"v0.4.11","_defaultsLoaded":true,"dist":{"shasum":"aec2818ecb10648a0f96229cca3a45731cb44673","tarball":"https://registry.npmjs.org/sink-test/-/sink-test-0.1.1.tgz","integrity":"sha512-hxHqa9vwX2iD1NgVX2f3usfZvsdJb8ELmvmvHtd400OHULemFV+iZWknn3em9OLGgoDphBMY5OgwLZ8+3j/5Jw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAT5stLG0Cil7jKbiYEOUyXetDniDoKxfxhfW7pc2w+vAiBHicF1BQucHIXc2LAaiDu/z7HimZuiloMdtzioy6+ZCQ=="}]},"maintainers":[{"name":"ded","email":"polvero@gmail.com"},{"name":"fat","email":"jacobthornton@gmail.com"}]},"1.0.0":{"name":"sink-test","description":"test your javascript - headless, or in the browser","version":"1.0.0","author":{"name":"Dustin Diaz","email":"polvero@gmail.com","url":"http://dustindiaz.com"},"keywords":["testing","unit tests","headless","tdd","async"],"main":"./src/sink.js","engines":{"node":">= 0.4.0"},"dependencies":{"colors":">= 0.5.0"},"_npmUser":{"name":"ded","email":"polvero@gmail.com"},"_id":"sink-test@1.0.0","devDependencies":{},"_engineSupported":true,"_npmVersion":"1.1.0-beta-10","_nodeVersion":"v0.6.7","_defaultsLoaded":true,"dist":{"shasum":"e9652beec26378172fe421b9112d8dc9e8bfc956","tarball":"https://registry.npmjs.org/sink-test/-/sink-test-1.0.0.tgz","integrity":"sha512-AX1JUekZxg7Ki2Q/HPk6hssZBl+vOHhHeVypG4KrHrUAGKmEQZYV0mcrFvm80ejhtSUfL+gjx+qVZ12hrikdeQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCfDkzg+SvOq7PTae4WBau53dnQV7rFjPlvSMLh0rGNZQIgGhY1X88jeCOytzZOAd7r5yWnJDAt9oiLxgJYIgkvgPU="}]},"readme":"Sink Test\n---------\n\nAn Asynchronous JavaScript Unit Testing Framework designed to run headless, or in the browser.\n\nSink test is used to test JavaScript that is run asynchronously whereby you can specify the number of expectations and Sink will tell you if they each pass successfully or call an optional `complete()` callback to indicate test completion.\n\nHow to write a Sink test\n------------------------\n\n``` js\ntest('should have foo', 2, function() {\n  $.ajax('/foo', function(resp) {\n    ok(resp.stat == '200')\n    assert(resp.text, 'success', 'should have success')\n  })\n})\n\n// alternatively:\n\ntest('should have foo', function(complete) {\n  $.ajax('/foo', function(resp) {\n    ok(resp.stat == '200')\n    assert(resp.text, 'success', 'should have success')\n    complete()\n  })\n})\n```\n\nLoading a suite of tests\n------------------------\n\nThe above example illustrates the basic syntax of a single test, however loading your tests is done via the *sink* module which exports the test and ok methods. See the example below:\n\n``` js\nsink('my module', function(test, ok, before, after, assert) {\n  before(function () {\n    // run this before every test\n  })\n\n  after(function () {\n    // run this after every test\n  })\n\n  test('should have foo', 2, function () {\n    ok(true, 'this is basically true')\n    ok(1 == 1, 'also true for you math majors')\n  })\n})\n\nsink('another module', function (t, o, b, a) {\n  test('a failure', 1, function () {\n    ok(1 == 2, 'should fail')\n  })\n})\n\nstart() // start all test modules\n```\n\nBrowser support\n---------------\n\nAny browser that supports JavaScript as well as Headless via command line with Node. (see below)\n\n``` js\n// tests.js\nvar sink = require('sink')\nvar start = sink.start\nsink = sink.sink\n\nsink('some module', function (test, ok) {\n  // write tests\n})\n\nsink('another module', function (test, ok) {\n  // write tests\n})\n\nstart()\n```\n\nin your terminal\n\n    $ node path/to/my/tests.js\n\n\nAdvanced assertion support\n--------------------------\n\nSink Test follows most of the assert module specified in the [CommonJS Unit-Testing/1.0 assert module](http://wiki.commonjs.org/wiki/Unit_Testing/1.0) and gives you additional convenience assertions plus an API to define your own assertions.\n\nBasic assert calls perform a strict equals:\n\n``` js\nassert(actual, expected, message); // performs: actual === expected\n```\n\nThe `assert` method is extended, giving you aliases for the above:\n\n``` js\nassert.same(actual, expected, message);\nassert.strictEqual(actual, expected, message);\n// and the inverse:\nassert.notSame(actual, expected, message);\nassert.notStrictEqual(actual, expected, message);\n```\n\nAnd also an alias for the simple boolean `ok` method:\n\n``` js\nassert.ok(value, message)\n```\n\nA non-strict deep equals is available via:\n\n``` js\nassert.equals(actual, expected, message);\nassert.deepEqual(actual, expected, message);\n// and the inverse:\nassert.notEqual(actual, expected, message);\n```\n\nAnd many additional assertions to make your tests clear and obvious:\n\n``` js\nassert.typeOf(value, type, message); // performs a \"typeof value == type\"\nassert.notTypeOf(value, type, message);\nassert.isDefined(value, message);\nassert.isUndefined(value, message);\nassert.isNull(value, message);\nassert.isNotNull(value, message);\nassert.isObject(value, message);\nassert.isFunction(value, message);\nassert.isString(value, message);\nassert.isNumber(value, message);\nassert.isTrue(value, message);\nassert.isFalse(value, message);\nassert.isBoolean(value, message);\nassert.isArray(value, message);\nassert.isElement(value, message); // is the value a DOM element\n```\n\nThe *message* parameter on all assertions is optional.\n\n### Custom assertions\n\nWhen you have a complex condition to assert, you can define a custom assertion for it with the `assert.add()` method.\n\nSimply provide your assertion name and the handler function. Handler functions can take one or two arguments:\n\n``` js\n// single-argument form:\nassert.add('isUpperCaseString', function (value) {\n  return typeof value == 'string' && value.toUpperCase() === value;\n});\n// use it:\nassert.isUpperCaseString('this will fail', 'should be an upper-case string'); // →  fail\nassert.isUpperCaseString('THIS WILL PASS', 'should be an upper-case string'); // →  pass\n\n// dual-argument form:\nassert.add('matchesRegex', function (actual, regex) {\n  return typeof actual == 'string' && regex.test(actual);\n});\n// use it:\nassert.matchesRegex('this will pass', / [wil]+ /, 'should match my \" [wil]+ \" regex');\n```\n\n\nHappy testing!\n","maintainers":[{"name":"ded","email":"polvero@gmail.com"},{"name":"fat","email":"jacobthornton@gmail.com"}]},"1.0.1":{"name":"sink-test","description":"test your javascript - headless, or in the browser","version":"1.0.1","author":{"name":"Dustin Diaz","email":"polvero@gmail.com","url":"http://dustindiaz.com"},"keywords":["testing","unit tests","headless","tdd","async"],"main":"./src/sink.js","engines":{"node":">= 0.4.0"},"dependencies":{"colors":">= 0.5.0"},"_npmUser":{"name":"ded","email":"polvero@gmail.com"},"_id":"sink-test@1.0.1","devDependencies":{},"_engineSupported":true,"_npmVersion":"1.1.0-beta-10","_nodeVersion":"v0.6.7","_defaultsLoaded":true,"dist":{"shasum":"73b9f98634c5c27b73c6d60a12b4a9e09248dbe1","tarball":"https://registry.npmjs.org/sink-test/-/sink-test-1.0.1.tgz","integrity":"sha512-YRB9hEBwqo5NTg3CtaqFb/JZpetLzyskRdbhIwJCKN+n2Drd3HzAutH5qWMsRxgO2nK98/uZizuKgvOVwl9bzg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGs59qy8oEQjP66eRpIZlV8yWh9Qf6bHJ+zeEoZekXaEAiEAtosaQ22ZCSBqol1SJYdLPiHt4XsPbYWXqROniPKmWYc="}]},"readme":"Sink Test\n---------\n\nAn Asynchronous JavaScript Unit Testing Framework designed to run headless, or in the browser.\n\nSink test is used to test JavaScript that is run asynchronously whereby you can specify the number of expectations and Sink will tell you if they each pass successfully or call an optional `complete()` callback to indicate test completion.\n\nHow to write a Sink test\n------------------------\n\n``` js\ntest('should have foo', 2, function() {\n  $.ajax('/foo', function(resp) {\n    ok(resp.stat == '200')\n    assert(resp.text, 'success', 'should have success')\n  })\n})\n\n// alternatively:\n\ntest('should have foo', function(complete) {\n  $.ajax('/foo', function(resp) {\n    ok(resp.stat == '200')\n    assert(resp.text, 'success', 'should have success')\n    complete()\n  })\n})\n```\n\nLoading a suite of tests\n------------------------\n\nThe above example illustrates the basic syntax of a single test, however loading your tests is done via the *sink* module which exports the test and ok methods. See the example below:\n\n``` js\nsink('my module', function(test, ok, before, after, assert) {\n  before(function () {\n    // run this before every test\n  })\n\n  after(function () {\n    // run this after every test\n  })\n\n  test('should have foo', 2, function () {\n    ok(true, 'this is basically true')\n    ok(1 == 1, 'also true for you math majors')\n  })\n})\n\nsink('another module', function (t, o, b, a) {\n  test('a failure', 1, function () {\n    ok(1 == 2, 'should fail')\n  })\n})\n\nstart() // start all test modules\n```\n\nBrowser support\n---------------\n\nAny browser that supports JavaScript as well as Headless via command line with Node. (see below)\n\n``` js\n// tests.js\nvar sink = require('sink')\nvar start = sink.start\nsink = sink.sink\n\nsink('some module', function (test, ok) {\n  // write tests\n})\n\nsink('another module', function (test, ok) {\n  // write tests\n})\n\nstart()\n```\n\nin your terminal\n\n    $ node path/to/my/tests.js\n\n\nAdvanced assertion support\n--------------------------\n\nSink Test follows most of the assert module specified in the [CommonJS Unit-Testing/1.0 assert module](http://wiki.commonjs.org/wiki/Unit_Testing/1.0) and gives you additional convenience assertions plus an API to define your own assertions.\n\nBasic assert calls perform a strict equals:\n\n``` js\nassert(actual, expected, message); // performs: actual === expected\n```\n\nThe `assert` method is extended, giving you aliases for the above:\n\n``` js\nassert.same(actual, expected, message);\nassert.strictEqual(actual, expected, message);\n// and the inverse:\nassert.notSame(actual, expected, message);\nassert.notStrictEqual(actual, expected, message);\n```\n\nAnd also an alias for the simple boolean `ok` method:\n\n``` js\nassert.ok(value, message)\n```\n\nA non-strict deep equals is available via:\n\n``` js\nassert.equals(actual, expected, message);\nassert.deepEqual(actual, expected, message);\n// and the inverse:\nassert.notEqual(actual, expected, message);\n```\n\nAnd many additional assertions to make your tests clear and obvious:\n\n``` js\nassert.typeOf(value, type, message); // performs a \"typeof value == type\"\nassert.notTypeOf(value, type, message);\nassert.isDefined(value, message);\nassert.isUndefined(value, message);\nassert.isNull(value, message);\nassert.isNotNull(value, message);\nassert.isObject(value, message);\nassert.isFunction(value, message);\nassert.isString(value, message);\nassert.isNumber(value, message);\nassert.isTrue(value, message);\nassert.isFalse(value, message);\nassert.isBoolean(value, message);\nassert.isArray(value, message);\nassert.isElement(value, message); // is the value a DOM element\n```\n\nThe *message* parameter on all assertions is optional.\n\n### Custom assertions\n\nWhen you have a complex condition to assert, you can define a custom assertion for it with the `assert.add()` method.\n\nSimply provide your assertion name and the handler function. Handler functions can take one or two arguments:\n\n``` js\n// single-argument form:\nassert.add('isUpperCaseString', function (value) {\n  return typeof value == 'string' && value.toUpperCase() === value;\n});\n// use it:\nassert.isUpperCaseString('this will fail', 'should be an upper-case string'); // →  fail\nassert.isUpperCaseString('THIS WILL PASS', 'should be an upper-case string'); // →  pass\n\n// dual-argument form:\nassert.add('matchesRegex', function (actual, regex) {\n  return typeof actual == 'string' && regex.test(actual);\n});\n// use it:\nassert.matchesRegex('this will pass', / [wil]+ /, 'should match my \" [wil]+ \" regex');\n```\n\n\nHappy testing!\n","maintainers":[{"name":"ded","email":"polvero@gmail.com"},{"name":"fat","email":"jacobthornton@gmail.com"}]},"1.0.2":{"name":"sink-test","description":"Headless / Browser JavaScript Unit Tester","version":"1.0.2","author":{"name":"Dustin Diaz","email":"polvero@gmail.com","url":"http://dustindiaz.com"},"contributors":[{"name":"Rod Vagg","email":"rod@vagg.org","url":"http://github.com/rvagg"}],"keywords":["testing","unit tests","headless","tdd","async"],"main":"./src/sink.js","engines":{"node":">= 0.4.0"},"dependencies":{"colors":">= 0.5.0"},"_npmUser":{"name":"ded","email":"polvero@gmail.com"},"_id":"sink-test@1.0.2","devDependencies":{},"_engineSupported":true,"_npmVersion":"1.1.0-beta-10","_nodeVersion":"v0.6.7","_defaultsLoaded":true,"dist":{"shasum":"fd2348dd7c3311ed5c58e3295989b581b37c548e","tarball":"https://registry.npmjs.org/sink-test/-/sink-test-1.0.2.tgz","integrity":"sha512-Yh+3ALIWaIqQ2p5X9/o2l7WAPXOaJvA6PM/DqQPX2K2NBl5+jZUPF/rvklj2X6EOnIuhlyyB4w24wFvTiCB90g==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIApuw/qH1e0skirgTYzngoMqcmK41ga3PM3j4P8LUPvWAiEA1g0cc1X4pSlswwaJdoGLPScejs7ZzAO1pKt25F1puAE="}]},"readme":"Sink Test\n---------\n\nAn Asynchronous JavaScript Unit Testing Framework designed to run headless, or in the browser.\n\nSink test is used to test JavaScript that is run asynchronously whereby you can specify the number of expectations and Sink will tell you if they each pass successfully or call an optional `complete()` callback to indicate test completion.\n\nHow to write a Sink test\n------------------------\n\n``` js\ntest('should have foo', 2, function() {\n  $.ajax('/foo', function(resp) {\n    ok(resp.stat == '200')\n    assert(resp.text, 'success', 'should have success')\n  })\n})\n\n// alternatively:\n\ntest('should have foo', function(complete) {\n  $.ajax('/foo', function(resp) {\n    ok(resp.stat == '200')\n    assert(resp.text, 'success', 'should have success')\n    complete()\n  })\n})\n```\n\nLoading a suite of tests\n------------------------\n\nThe above example illustrates the basic syntax of a single test, however loading your tests is done via the *sink* module which exports the test and ok methods. See the example below:\n\n``` js\nsink('my module', function(test, ok, before, after, assert) {\n  before(function () {\n    // run this before every test\n  })\n\n  after(function () {\n    // run this after every test\n  })\n\n  test('should have foo', 2, function () {\n    ok(true, 'this is basically true')\n    ok(1 == 1, 'also true for you math majors')\n  })\n})\n\nsink('another module', function (t, o, b, a) {\n  test('a failure', 1, function () {\n    ok(1 == 2, 'should fail')\n  })\n})\n\nstart() // start all test modules\n```\n\nBrowser support\n---------------\n\nAny browser that supports JavaScript as well as Headless via command line with Node. (see below)\n\n``` js\n// tests.js\nvar sink = require('sink')\nvar start = sink.start\nsink = sink.sink\n\nsink('some module', function (test, ok) {\n  // write tests\n})\n\nsink('another module', function (test, ok) {\n  // write tests\n})\n\nstart()\n```\n\nin your terminal\n\n    $ node path/to/my/tests.js\n\n\nAdvanced assertion support\n--------------------------\n\nSink Test follows most of the assert module specified in the [CommonJS Unit-Testing/1.0 assert module](http://wiki.commonjs.org/wiki/Unit_Testing/1.0) and gives you additional convenience assertions plus an API to define your own assertions.\n\nBasic assert calls perform a strict equals:\n\n``` js\nassert(actual, expected, message); // performs: actual === expected\n```\n\nThe `assert` method is extended, giving you aliases for the above:\n\n``` js\nassert.same(actual, expected, message);\nassert.strictEqual(actual, expected, message);\n// and the inverse:\nassert.notSame(actual, expected, message);\nassert.notStrictEqual(actual, expected, message);\n```\n\nAnd also an alias for the simple boolean `ok` method:\n\n``` js\nassert.ok(value, message)\n```\n\nA non-strict deep equals is available via:\n\n``` js\nassert.equals(actual, expected, message);\nassert.deepEqual(actual, expected, message);\n// and the inverse:\nassert.notEqual(actual, expected, message);\n```\n\nAnd many additional assertions to make your tests clear and obvious:\n\n``` js\nassert.typeOf(value, type, message); // performs a \"typeof value == type\"\nassert.notTypeOf(value, type, message);\nassert.isDefined(value, message);\nassert.isUndefined(value, message);\nassert.isNull(value, message);\nassert.isNotNull(value, message);\nassert.isObject(value, message);\nassert.isFunction(value, message);\nassert.isString(value, message);\nassert.isNumber(value, message);\nassert.isTrue(value, message);\nassert.isFalse(value, message);\nassert.isBoolean(value, message);\nassert.isArray(value, message);\nassert.isElement(value, message); // is the value a DOM element\n```\n\nThe *message* parameter on all assertions is optional.\n\n### Custom assertions\n\nWhen you have a complex condition to assert, you can define a custom assertion for it with the `assert.add()` method.\n\nSimply provide your assertion name and the handler function. Handler functions can take one or two arguments:\n\n``` js\n// single-argument form:\nassert.add('isUpperCaseString', function (value) {\n  return typeof value == 'string' && value.toUpperCase() === value;\n});\n// use it:\nassert.isUpperCaseString('this will fail', 'should be an upper-case string'); // →  fail\nassert.isUpperCaseString('THIS WILL PASS', 'should be an upper-case string'); // →  pass\n\n// dual-argument form:\nassert.add('matchesRegex', function (actual, regex) {\n  return typeof actual == 'string' && regex.test(actual);\n});\n// use it:\nassert.matchesRegex('this will pass', / [wil]+ /, 'should match my \" [wil]+ \" regex');\n```\n\n\nHappy testing!\n","maintainers":[{"name":"ded","email":"polvero@gmail.com"},{"name":"fat","email":"jacobthornton@gmail.com"}]}},"maintainers":[{"name":"ded","email":"polvero@gmail.com"},{"name":"fat","email":"jacobthornton@gmail.com"}],"time":{"modified":"2022-06-26T20:14:29.132Z","created":"2011-03-14T21:51:35.452Z","0.0.3":"2011-03-14T21:51:35.712Z","0.0.4":"2011-04-07T22:39:14.182Z","0.0.5":"2011-05-03T19:36:56.573Z","0.0.6":"2011-05-24T01:33:01.986Z","0.0.7":"2011-06-26T03:47:01.900Z","0.0.8":"2011-06-26T04:33:09.249Z","0.0.9":"2011-09-12T21:08:00.482Z","0.1.0":"2011-09-13T21:28:43.761Z","0.1.1":"2011-09-26T20:04:38.951Z","1.0.0":"2012-02-07T18:28:07.017Z","1.0.1":"2012-02-10T17:52:37.068Z","1.0.2":"2012-02-13T18:47:03.349Z"},"author":{"name":"Dustin Diaz","email":"polvero@gmail.com","url":"http://dustindiaz.com"}}