{"_attachments":{},"_id":"testjs","_rev":"1227623-61f2d860bab12518003bbe11","author":{"name":"Daniel Wirtz","email":"dcode@dcode.io"},"description":"A compact testing module for node.js.","dist-tags":{"latest":"1.0.4"},"license":"Apache-2.0","maintainers":[{"name":"dcode","email":"dcode@dcode.io"}],"name":"testjs","readme":"![test.js](https://raw.github.com/dcodeIO/test.js/master/test.png)\r\n---------\r\n**test.js** is a compact testing module for node.js that simply wraps node's assert module and generates pretty printed\r\noutput.\r\n\r\n* Small footprint, minimal dependencies\r\n* Non-utf8 and Windows terminal approved\r\n* Allows asynchronous testing\r\n* Allows modular tests by just assembling data structures\r\n* Simple API and Cli (just `testjs`)\r\n* Emphasis on timers\r\n* Available through [npm](https://npmjs.org/package/testjs): `npm -g install testjs`\r\n\r\n
\r\n \r\n
\r\n\r\nUsage\r\n-----\r\n\r\n#### Cli\r\nPlace your test suite in `tests/suite.js`.\r\n\r\n```javascript\r\n// package.json\r\n...\r\n{\r\n \"devDependencies\": {\r\n \"testjs\": \"latest\"\r\n },\r\n \"scripts\": {\r\n \"test\": \"testjs\"\r\n }\r\n}\r\n...\r\n```\r\n\r\n`npm test`\r\n\r\n#### API\r\n\r\n```javascript\r\n// tests/run.js\r\nvar Suite = require(\"testjs\");\r\n\r\nSuite.run({\r\n \"firsttest\": function(test) {\r\n ...\r\n test.done();\r\n },\r\n ...\r\n});\r\n```\r\n\r\n```javascript\r\n// package.json\r\n...\r\n{\r\n \"scripts\": {\r\n \"test\": \"node tests/run.js\"\r\n }\r\n}\r\n```\r\n\r\n`npm test`\r\n\r\nAssertions\r\n----------\r\nAll of [node's assert](http://nodejs.org/api/assert.html) (just replace `assert` through `test`) plus `test.notOk(...)`\r\nas a negated `ok`.\r\n\r\n* `test#ok(actual)` / `test#notOk(actual)` / `test#ifError(actual)`\r\n* `test#equal(actual, expected)` / `test#notEqual(actual, notExpected)`\r\n* `test#deepEqual(actual, expected)` / `test#notDeepEqual(actual, notExpected)`\r\n* `test#strictEqual(actual, expected)` / `test#notStrictEqual(actual, notExpected)`\r\n* `test#throws(blockFunction[, classRegExpOrValidationFunction])` / `test#doesNotThrow(blockFunction)`\r\n\r\nThere is also a `test#log(...)` for logging straight to the test console.\r\n\r\nSelf-explaining examples\r\n------------------------\r\n* [tests/suite.js](https://github.com/dcodeIO/test.js/blob/master/tests/suite.js) - test suite as a module\r\n* [tests/run.js](https://github.com/dcodeIO/test.js/blob/master/tests/run.js) - runs it through the API\r\n\r\nWhen typing `testjs` in a terminal, `tests/suite.js` will be run. Also supports running runners:\r\n`testjs tests/run.js` or custom / other unit tests under the condition that the runner (here: `run.js`) does not export\r\nanything. If it does, whatever it exports will be run.\r\n\r\nInteroperability\r\n----------------\r\ntest.js is partially interoperable with nodeunit. There is no setUp/tearDown however and there are no aliases for\r\nthings like `equal`, which is for example aliased as `equals` in nodeunit. However, test.js including dependencies is\r\nabout 100kb while nodeunit is about 16mb.\r\n\r\nCommand line options\r\n--------------------\r\n\r\n| Option | Function\r\n| -------------------------- | -----------------------------------------------------------------------------------------\r\n| `--nocolors` or `-nc` | Disables terminal colors.\r\n| `--name=NAME` or `-n=NAME` | Sets the suite name. Defaults to the name defined in package.json which is looked up inside of the current working directory or to the base name of the suite file if there is no package.json. The hard coded default is `suite`.\r\n| `--silent` or `-s` | Does not produce any output.\r\n\r\nAlways returns the number of failed tests as the status code.\r\n\r\nExample: `testjs --name=MyGame -nc tests/mygame-test.js`\r\n\r\nLicense\r\n-------\r\nApache License, Version 2.0\r\n","time":{"created":"2022-01-27T17:37:36.522Z","modified":"2022-01-27T17:37:36.522Z","0.2.0":"2013-05-03T16:35:17.676Z","0.2.2":"2013-05-03T22:06:09.357Z","0.2.3":"2013-07-01T15:23:48.786Z","0.2.4":"2013-07-01T15:31:44.591Z","1.0.0":"2013-11-18T22:07:28.954Z","1.0.1":"2014-07-15T15:40:11.088Z","1.0.2":"2014-07-15T17:57:31.803Z","1.0.3":"2014-08-04T15:47:59.610Z","1.0.4":"2014-11-04T16:02:35.010Z"},"versions":{"0.2.0":{"name":"testjs","description":"No fancy crap, just testing like a man.","version":"0.2.0","author":{"name":"Daniel Wirtz","email":"dcode@dcode.io"},"repository":{"type":"git","url":"https://github.com/dcodeIO/test.js.git"},"bugs":{"url":"https://github.com/dcodeIO/test.js/issues"},"keywords":["testing","spec","test","development","dev","unit test","unittest"],"main":"./test.js","bin":{"testjs":"./bin/testjs","test":"./bin/test"},"dependencies":{"ascli":"latest"},"devDependencies":{},"license":"Apache-2.0","scripts":{"test":"node tests/run.js"},"_id":"testjs@0.2.0","dist":{"shasum":"e4c2ab1e07fbf1b1a199f317a280c3d90e36e43a","tarball":"https://registry.npmmirror.com/testjs/-/testjs-0.2.0.tgz","size":55639,"integrity":"sha512-FAuuKNixyiIYvd36+Nc4w3fTLByfJxZtD6SSyO0wgfwc7y08EGqMEopYyK31dP+PGJYGk/9VxPzAmS91FcnXIw=="},"_from":".","_npmVersion":"1.2.18","_npmUser":{"name":"dcode","email":"dcode@dcode.io"},"maintainers":[{"name":"dcode","email":"dcode@dcode.io"}],"directories":{},"_cnpmcore_publish_time":"2021-12-23T19:18:20.518Z"},"0.2.2":{"name":"testjs","description":"No fancy crap, just testing like a man.","version":"0.2.2","author":{"name":"Daniel Wirtz","email":"dcode@dcode.io"},"repository":{"type":"git","url":"https://github.com/dcodeIO/test.js.git"},"bugs":{"url":"https://github.com/dcodeIO/test.js/issues"},"keywords":["testing","spec","test","development","dev","unit test","unittest"],"main":"./test.js","bin":{"testjs":"./bin/testjs","test":"./bin/test"},"dependencies":{"ascli":"latest"},"devDependencies":{},"license":"Apache-2.0","scripts":{"test":"node ./tests/run.js"},"_id":"testjs@0.2.2","dist":{"shasum":"aae7c3cf9182e64b184c79e131ebff5b20b610c2","tarball":"https://registry.npmmirror.com/testjs/-/testjs-0.2.2.tgz","size":55685,"integrity":"sha512-4GTdR+Qu0NRgxAfvlxq4plcd9fpeaDgqNetFEB5vw17ya1XT/uNGc7KrcD5X18f69aWN1xWuGaQahX6Nxmhi4w=="},"_from":".","_npmVersion":"1.2.18","_npmUser":{"name":"dcode","email":"dcode@dcode.io"},"maintainers":[{"name":"dcode","email":"dcode@dcode.io"}],"directories":{},"_cnpmcore_publish_time":"2021-12-23T19:18:21.807Z"},"0.2.3":{"name":"testjs","description":"No fancy crap, just testing like a man.","version":"0.2.3","author":{"name":"Daniel Wirtz","email":"dcode@dcode.io"},"repository":{"type":"git","url":"https://github.com/dcodeIO/test.js.git"},"bugs":{"url":"https://github.com/dcodeIO/test.js/issues"},"keywords":["testing","spec","test","development","dev","unit test","unittest"],"main":"./test.js","bin":{"testjs":"./bin/testjs","test":"./bin/test"},"dependencies":{"ascli":"latest"},"devDependencies":{},"license":"Apache-2.0","scripts":{"test":"node ./tests/run.js"},"_id":"testjs@0.2.3","dist":{"shasum":"042ff2ce92d648496095d1d4693214a0840e51fc","tarball":"https://registry.npmmirror.com/testjs/-/testjs-0.2.3.tgz","size":10532,"integrity":"sha512-F9opWyVKxMT0XX7kplak34t+KTQIKJJTm4jrx1xDdVBZpUf8ebzr3O9DPdpMieRjeyQtxWfPHMMdc2nvZHYldg=="},"_from":".","_npmVersion":"1.2.32","_npmUser":{"name":"dcode","email":"dcode@dcode.io"},"maintainers":[{"name":"dcode","email":"dcode@dcode.io"}],"directories":{},"_cnpmcore_publish_time":"2021-12-23T19:18:22.691Z"},"0.2.4":{"name":"testjs","description":"No fancy crap, just testing like a man.","version":"0.2.4","author":{"name":"Daniel Wirtz","email":"dcode@dcode.io"},"repository":{"type":"git","url":"https://github.com/dcodeIO/test.js.git"},"bugs":{"url":"https://github.com/dcodeIO/test.js/issues"},"keywords":["testing","spec","test","development","dev","unit test","unittest"],"main":"./test.js","bin":{"testjs":"./bin/testjs","test":"./bin/test"},"dependencies":{"ascli":"latest"},"devDependencies":{},"license":"Apache-2.0","scripts":{"test":"node ./tests/run.js"},"_id":"testjs@0.2.4","dist":{"shasum":"04b63361b04cc1f73dcd428f4a1293a340520152","tarball":"https://registry.npmmirror.com/testjs/-/testjs-0.2.4.tgz","size":10573,"integrity":"sha512-ZFV96yHvAeq4Lq6vc+2Opf7wrCaSSP/kETWm2BvdvAtZRKBcQC9Q1NSXSnoyUYcXoOZxLINCauP8Wj89tlq03Q=="},"_from":".","_npmVersion":"1.2.32","_npmUser":{"name":"dcode","email":"dcode@dcode.io"},"maintainers":[{"name":"dcode","email":"dcode@dcode.io"}],"directories":{},"_cnpmcore_publish_time":"2021-12-23T19:18:23.554Z"},"1.0.0":{"name":"testjs","description":"No fancy crap, just testing like a man.","version":"1.0.0","author":{"name":"Daniel Wirtz","email":"dcode@dcode.io"},"repository":{"type":"git","url":"https://github.com/dcodeIO/test.js.git"},"bugs":{"url":"https://github.com/dcodeIO/test.js/issues"},"keywords":["testing","spec","test","development","dev","unit test","unittest"],"main":"./test.js","bin":{"testjs":"./bin/testjs"},"dependencies":{"ascli":"latest"},"devDependencies":{},"license":"Apache-2.0","scripts":{"test":"node ./tests/run.js"},"_id":"testjs@1.0.0","dist":{"shasum":"28fa9abb0c292f38a201dd6c55c76b3af1830fa0","tarball":"https://registry.npmmirror.com/testjs/-/testjs-1.0.0.tgz","size":10515,"integrity":"sha512-Mn6DlxG9hCYlWhATZisRE3dXHxZ7Q4pw9Ex80OVocRttABj7dIAjkCxe3/aXD0LJiLkwDj8MAAQ/EmKT3TYnhw=="},"_from":".","_npmVersion":"1.2.32","_npmUser":{"name":"dcode","email":"dcode@dcode.io"},"maintainers":[{"name":"dcode","email":"dcode@dcode.io"}],"directories":{},"_cnpmcore_publish_time":"2021-12-23T19:18:24.422Z"},"1.0.1":{"name":"testjs","description":"A compact testing module for node.js.","version":"1.0.1","author":{"name":"Daniel Wirtz","email":"dcode@dcode.io"},"repository":{"type":"git","url":"https://github.com/dcodeIO/test.js.git"},"bugs":{"url":"https://github.com/dcodeIO/test.js/issues"},"keywords":["testing","spec","test","development","dev","unit test","unittest"],"main":"./test.js","bin":{"testjs":"./bin/testjs"},"dependencies":{"ascli":"latest"},"devDependencies":{},"license":"Apache-2.0","scripts":{"test":"node ./tests/run.js"},"homepage":"https://github.com/dcodeIO/test.js","_id":"testjs@1.0.1","_shasum":"a8b96859859a088558b0e402c085f6e7c64e1e32","_from":".","_npmVersion":"1.4.9","_npmUser":{"name":"dcode","email":"dcode@dcode.io"},"maintainers":[{"name":"dcode","email":"dcode@dcode.io"}],"dist":{"shasum":"a8b96859859a088558b0e402c085f6e7c64e1e32","tarball":"https://registry.npmmirror.com/testjs/-/testjs-1.0.1.tgz","size":13637,"integrity":"sha512-uWvdSRF4sO+aJI4tPwscZJY6QSg6Uu4hm0ogfWUlOgOZtRcqw1KbQDkbEmJcyDMBLWEJdcjs+3SArLPUA6VjGQ=="},"directories":{},"_cnpmcore_publish_time":"2021-12-23T19:18:25.507Z"},"1.0.2":{"name":"testjs","description":"A compact testing module for node.js.","version":"1.0.2","author":{"name":"Daniel Wirtz","email":"dcode@dcode.io"},"repository":{"type":"git","url":"https://github.com/dcodeIO/test.js.git"},"bugs":{"url":"https://github.com/dcodeIO/test.js/issues"},"keywords":["testing","spec","test","development","dev","unit test","unittest"],"main":"./test.js","bin":{"testjs":"./bin/testjs"},"dependencies":{"ascli":"latest"},"devDependencies":{},"license":"Apache-2.0","scripts":{"test":"node ./tests/run.js"},"homepage":"https://github.com/dcodeIO/test.js","_id":"testjs@1.0.2","_shasum":"1249c39230f6f9f23ecdf9f990b71662e92ccf06","_from":".","_npmVersion":"1.4.9","_npmUser":{"name":"dcode","email":"dcode@dcode.io"},"maintainers":[{"name":"dcode","email":"dcode@dcode.io"}],"dist":{"shasum":"1249c39230f6f9f23ecdf9f990b71662e92ccf06","tarball":"https://registry.npmmirror.com/testjs/-/testjs-1.0.2.tgz","size":13469,"integrity":"sha512-T6nNuIIa8v6KYu9ReKnna13xqj6MWNpmqs3bokx5EV6DuVFSvoEqDlgb3XVuHnMD7ySqk577Ud0abH9gYZAf6w=="},"directories":{},"_cnpmcore_publish_time":"2021-12-23T19:18:26.393Z"},"1.0.3":{"name":"testjs","description":"A compact testing module for node.js.","version":"1.0.3","author":{"name":"Daniel Wirtz","email":"dcode@dcode.io"},"repository":{"type":"git","url":"https://github.com/dcodeIO/test.js.git"},"bugs":{"url":"https://github.com/dcodeIO/test.js/issues"},"keywords":["testing","spec","test","development","dev","unit test","unittest"],"main":"./test.js","bin":{"testjs":"./bin/testjs"},"dependencies":{"ascli":"latest"},"devDependencies":{},"license":"Apache-2.0","scripts":{"test":"node ./tests/run.js"},"gitHead":"caebef5940738a647ed4f6d3f9a8da22a7fec818","homepage":"https://github.com/dcodeIO/test.js","_id":"testjs@1.0.3","_shasum":"868922cb3dc445563ae115ef8f4c194bc08a0c8c","_from":".","_npmVersion":"1.4.21","_npmUser":{"name":"dcode","email":"dcode@dcode.io"},"maintainers":[{"name":"dcode","email":"dcode@dcode.io"}],"dist":{"shasum":"868922cb3dc445563ae115ef8f4c194bc08a0c8c","tarball":"https://registry.npmmirror.com/testjs/-/testjs-1.0.3.tgz","size":13476,"integrity":"sha512-49SvSMcJkk60c1Ikq/XPDwnlFIi1qLA/vXu+Xl9aWr8LoYwibU8cV2KoJWw8poFqEldSgJDuOSdQtqA0QixveQ=="},"directories":{},"_cnpmcore_publish_time":"2021-12-23T19:18:27.251Z"},"1.0.4":{"name":"testjs","description":"A compact testing module for node.js.","version":"1.0.4","author":{"name":"Daniel Wirtz","email":"dcode@dcode.io"},"repository":{"type":"git","url":"https://github.com/dcodeIO/test.js.git"},"bugs":{"url":"https://github.com/dcodeIO/test.js/issues"},"keywords":["testing","spec","test","development","dev","unit test","unittest"],"main":"./test.js","bin":{"testjs":"./bin/testjs"},"dependencies":{"ascli":"~0.3"},"devDependencies":{},"license":"Apache-2.0","scripts":{"test":"node ./tests/run.js"},"gitHead":"0a8cd2f0a956ddb44736b706db72bb7d6d10c9de","homepage":"https://github.com/dcodeIO/test.js","_id":"testjs@1.0.4","_shasum":"0fd6c8a89a9249a447645cd3365dacbbaefbf55e","_from":".","_npmVersion":"1.4.21","_npmUser":{"name":"dcode","email":"dcode@dcode.io"},"maintainers":[{"name":"dcode","email":"dcode@dcode.io"}],"dist":{"shasum":"0fd6c8a89a9249a447645cd3365dacbbaefbf55e","tarball":"https://registry.npmmirror.com/testjs/-/testjs-1.0.4.tgz","size":13583,"integrity":"sha512-4hUkVpS6FOOa5xAcKvr4dcU3mK4W4SyiJRHIW1z2/BVtcvmIZEn6uCaWX5C5NUYaJm0S3/QAlFUfMBB/dJCxPw=="},"directories":{},"_cnpmcore_publish_time":"2021-12-23T19:18:28.139Z"}},"_source_registry_name":"default"}