{"dist":{"shasum":"2b321796430a6e0c18ce653fb11cc10de4a49331","tarball":"https://registry.npmjs.org/patr/-/patr-0.0.1.tgz","integrity":"sha512-8Qun0PpYFxCIjebT8w8H2KemwwjI7d4rA1/HfH/HAJn1aLolwQCWaH3Tsre+0zh4ieMEGgcOw8wg23c29itN7g==","signatures":[{"sig":"MEUCIQCetiTq06YHZpyhgoWT4lr4/F0XJ76LsrYmzjXl613asQIgEtdtjQpAd1kcHlVbhVX41yqDGRwl9ZeQhg4fecWNy+s=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"name":"patr","type":"zip","author":{"name":"Kris Zyp"},"readme":"Promised-based Asynchronous Test Runner (patr) is a very simple, easy-to-use test\nrunner that support asynchronous JavaScript testing with promises. Patr is based on\nthe premise that testing should be as simple as creating an object with\nmethods to perform tests. Objects can be nested to create subgroups of tests.\nPatr relies on the system's \"assert\" module for making assertions. An example test:\n\n    var assert = require(\"assert\");\n    require(\"patr/runner\").run({testMath: function(){\n      assert.equal(3, Math.min(3, 5));\n    });\n\nThe suggested pattern for writing test files is to define the tests on the\nexports object and running the test runner if the module is the main module.\nThis allows for direct execution of test files and easy inclusion of tests\ninto other test groups. For example, we could define \"my-math-test.js\":\n\n    var assert = require(\"assert\");\n    exports.testMath = function(){\n      assert.equal(3, Math.min(3, 5));\n    };\n    \n    if(require.main == module)\n      require(\"patr/runner\").run(exports);\n\nNow we can directly execute \"my-math-test.js\" or we could include it in another\ntest file:\n\n    exports.mathTests = require(\"my-math-test\");\n    exports.otherTests = require(\"other-tests\");\n    \n    if(require.main == module)\n      require(\"patr/runner\").run(exports);\n\nWith these aggregate test module, each test file's tests are included in a nested object\nthat will be tested as a subgroup of tests.\n\nUsing Promises for Asynchronous Testing\n==========================\n\nPromises make asynchronous testing very simple. You simply return a promise from \nyour test to indicate when a test is completed. When using promise-based coding this\nis super simple. For example, to test the contents of file loaded asynchronously using\npromised-io's fs module:\n\n    var fs = require(\"promised-io/fs\");\n\n    exports.testFile = function(){\n      return fs.readFile(\"testfile\").then(function(contents){\n        assert.equal(contents.toString(), \"expected contents\");\n      });\n    };\n    ...\n\nPatr is part of the Persevere project, and therefore is licensed under the\nAFL or BSD license. The Persevere project is administered under the Dojo foundation,\nand all contributions require a Dojo CLA.","overlay":{"npm":{"main":"./lib/runner","directories":{"lib":"./lib"},"dependencies":{"promised-io":"*"}}},"scripts":{},"keywords":["test","promise"],"location":"http://github.com/kriszyp/patr/zipball/master","mappings":{"promised-io":"jar:http://github.com/kriszyp/promised-io/zipball/master!/lib/"},"githubName":"patr","description":"Promised-based Asynchronous Test Runner (patr) is a very simple, easy-to-use test runner that support asynchronous JavaScript testing with promises. Patr is based on the premise that testing should be as simple as creating an object with methods to perform tests. Objects can be nested to create subgroups of tests. Patr relies on the system's \"assert\" module for making assertions. An example test:","directories":{},"maintainers":[{"name":"Kris Zyp","email":"kriszyp@gmail.com"}],"contributors":[],"dependencies":{"promised-io":""},"_id":"patr@0.0.1","version":"0.0.1"}