{"name":"test-runner","author":{"name":"Lloyd Brookes","email":"75pound@gmail.com"},"version":"0.9.4","description":"Fully-featured, lightweight command-line test runner","bin":{"test-runner":"bin/cli.mjs"},"repository":{"type":"git","url":"git+https://github.com/test-runner-js/test-runner.git"},"exports":{"import":"./index.mjs","require":"./dist/index.cjs"},"keywords":["test-runner","test","runner","cli","unit","testing","tool","tape","tap","ava","mocha"],"license":"MIT","engines":{"node":">=14"},"scripts":{"test":"node test/tests.mjs","docs":"jsdoc2md index.js > docs/API.md","dist":"rollup --exports auto -f cjs -o dist/index.cjs index.mjs"},"dependencies":{"@test-runner/default-view":"^0.5.4","@test-runner/live-view":"^0.1.7","@test-runner/oneline-view":"^0.1.4","command-line-args":"^5.1.1","command-line-usage":"^6.1.1","current-module-paths":"^0.1.0","file-set":"^5.0.1","load-module":"^4.0.1","reduce-flatten":"^3.0.1","test-object-model":"^0.7.1","test-runner-core":"^0.9.0","walk-back":"^5.0.0"},"devDependencies":{"jsdoc-to-markdown":"^7.0.1","node-fetch":"^2.6.1","rollup":"^2.52.3"},"gitHead":"c720d4fffbd0a89c1f29de444ea1fe720b8d23ae","bugs":{"url":"https://github.com/test-runner-js/test-runner/issues"},"homepage":"https://github.com/test-runner-js/test-runner#readme","_id":"test-runner@0.9.4","_nodeVersion":"16.4.0","_npmVersion":"7.18.1","dist":{"integrity":"sha512-jv8ZJnqup88A/SlNq91Ys8ZaGbFhLz8NkJDn0W/M+ksCb00KEvZZyPtqGKPuvAsC0IndkWl/LiHfTN9HyUxoAw==","shasum":"093f3827a5128450b7f4399adeb572d5b42ecb05","tarball":"http://registry-npm.ywwl.com/test-runner/download/test-runner-0.9.4.tgz","fileCount":7,"unpackedSize":27837,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg2zzlCRA9TVsSAnZWagAAea8P/2x0p1Ots8AUnShiWuhQ\nwSH54vZL9G1LN1P7DydU3rajXreDcjhO5ktM7a73V1QrikJ4TZUH7+6oJt2/\niVxAuREcXvnTafa8HcMuING52Br0O3neAsQA8SDiUDkGe4ncBjrzBHKKlI7V\noAJZcWZzasWmvdP5BGc2+t+KvAPK3Fcej4vxEHugByU7/b03dEUgZLnQfE+F\nd+mzOt7DG9mR+PteBdunMTAPNJAwaWL32lHXsTOkm8TbvbaI1LgJJ31dU/Hx\nF6O26kZOFw1QmF7KtOLn4s4FCZEiuSVc4ElPF15EhFpCBbg8h05N/1I+XQuN\n6TmiVYBZtttStALErpPWcrkuPCRGJXNEGFgWCrkJi3sV21UJu6yLQ3FC8c/s\nLxO+hFDYM64YqttPQ9CoGfeN69EYiM8YV/c8kUAi6udWOaZ0tDBMX+mbIiBX\nHZn2DELC/gn/sn9tD2ZluApZ4phQxTpPeXK1bAKJYzwmYBr/el5smt/QOuaA\nkcBx4rkb0gKVmW+UkOwnLEQ2qgnU6QOztig5ClT8ELQTHRwFpQaRk3LsE307\nx6uP3vYxEb5uiiURq3AKQrcGPMGgIRyc4cDndY9G33DOqBCeZjOTkj/LSgPi\nWoqO1e5ckYJA0Qykhrjqdw4mEpjKGvPMMVKrwg7nKddUCyQsj8Zhf1J0TdbI\nRStM\r\n=7EtE\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDwK7quUIlui1WMdV8iHEZ8kds8tZKxUTF4InLMoxyx8wIgQUH0hfGZ8D3Adikm7gHPbbC1CtlyINv14ePl2Jg0C/4="}],"size":7125,"noattachment":false,"key":"/test-runner/-/test-runner-0.9.4.tgz"},"_npmUser":{"name":"75lb","email":"75pound@gmail.com"},"directories":{},"maintainers":[{"name":"75lb","email":"75pound@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/test-runner_0.9.4_1624980709251_0.44135212468706086"},"_hasShrinkwrap":false,"readme":"[![view on npm](https://badgen.net/npm/v/test-runner)](https://www.npmjs.org/package/test-runner)\n[![npm module downloads](https://badgen.net/npm/dt/test-runner)](https://www.npmjs.org/package/test-runner)\n[![Gihub repo dependents](https://badgen.net/github/dependents-repo/test-runner-js/test-runner)](https://github.com/test-runner-js/test-runner/network/dependents?dependent_type=REPOSITORY)\n[![Gihub package dependents](https://badgen.net/github/dependents-pkg/test-runner-js/test-runner)](https://github.com/test-runner-js/test-runner/network/dependents?dependent_type=PACKAGE)\n[![Node.js CI](https://github.com/test-runner-js/test-runner/actions/workflows/node.js.yml/badge.svg)](https://github.com/test-runner-js/test-runner/actions/workflows/node.js.yml)\n[![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg)](https://github.com/feross/standard)\n\n# test-runner\n\n***This project and documentation are a WIP***\n\nFully-featured, lightweight command-line test runner. Part of a suite of tools to help the full-stack JavaScript engineer create and test modern, isomorphic code.\n\n## Synopsis\n\nAs input, test-runner takes one or more files each exporting a set of tests. The tests in each file are run with a controllable order and concurrency, a report is printed and the command exits with a non-zero code if anything failed.\n\nThis is the general syntax (see [here](https://github.com/test-runner-js/test-runner/wiki/test-runner-command-line-options) for the full usage guide):\n\n```\n$ test-runner [<options>] <file> ...\n```\n\n### Test file basics\n\nA test file is a module (either CommonJS or ECMAScript) which must export a [test object model](https://github.com/test-runner-js/test-object-model) instance. This test file can be run natively (no build or transpilation step required) in Node.js, the browser (in headless Chromium) or both (isomorphic).\n\nAdd tests to the model by invoking [`tom.test`](https://github.com/test-runner-js/test-object-model/blob/master/docs/API.md#module_test-object-model--Tom+test) with a name and test function. Trivial example. **If a test function throws or returns a rejected promise it is considered a fail, otherwise a pass**.\n\n```js\nconst { Tom } = require('test-runner')\n\nconst tom = new Tom()\n\ntom.test('A successful sync test', function () {\n  return 'This passed'\n})\n\ntom.test('A failing sync test', function () {\n  throw new Error('This failed')\n})\n\ntom.test('A successful async test', async function () {\n  return 'This passed'\n})\n\ntom.test('A failing async test', async function () {\n  throw new Error('This failed')\n})\n\ntom.test('Also a failing async test', async function () {\n  return Promise.reject(new Error('This failed'))\n})\n\nmodule.exports = tom\n```\n\n### Test CommonJS JavaScript using Node.js\n\nIn reality, a typical test suite might look more like this. Save this as `test.js`.\n\n```js\nconst { Tom } = require('test-runner')\nconst assert = require('assert').strict\nconst fetch = require('node-fetch')\n\nconst tom = new Tom()\n\ntom.test('Math.random() should return a number between 0 and 1', function () {\n  const result = Math.random()\n  assert.equal(typeof result, 'number')\n  assert.ok(result >= 0 && result <= 1)\n})\n\ntom.test('REST API should return the current todo item', async function () {\n  const response = await fetch('https://jsonplaceholder.typicode.com/todos/1')\n  const todo = await response.json()\n  assert.equal(todo.userId, 1)\n  assert.equal(todo.title, 'delectus aut autem')\n})\n\nmodule.exports = tom\n```\n\nRun the test file using test-runner.\n\n```\n$ npx test-runner test.js\n\nStart: 2 tests loaded\n\n✓ synopsis Math.random() should return a number between 0 and 1\n✓ synopsis REST API should return the current todo item\n\nCompleted in 199ms. Pass: 2, fail: 0, skip: 0.\n```\n\n### More examples\n\n* [How to test ECMAScript modules using Node.js](https://github.com/test-runner-js/test-runner/wiki/How-to-test-ECMAScript-modules-using-Node.js)\n* [How to test ECMAScript modules in the browser](https://github.com/test-runner-js/test-runner/wiki/How-to-test-ECMAScript-modules-in-the-browser)\n\n\n## Install\n\n```\n$ npm install --save-dev test-runner\n```\n\n## Test-runner tool kit\n\nAlternatively, you can run your tests with any of the following runners - each is compatible with test-object-model.\n\n| Environment  | Description                          | Tool          |\n| -----------  | ------------------------             | ------------- |\n| Web          | Run your tests in a headless Chromium browser from the command line | [web-runner](https://github.com/test-runner-js/web-runner)    |\n| Node.js | Test ECMAScript modules natively in Node.js | [esm-runner](https://github.com/test-runner-js/esm-runner) |\n\n## See also\n\nPlease see [the wiki](https://github.com/test-runner-js/test-runner/wiki) for more examples.\n\n* * *\n\n&copy; 2016-22 Lloyd Brookes \\<75pound@gmail.com\\>.\n","publish_time":1624980709401,"_cnpm_publish_time":1624980709401,"dist-tags":{"latest":"0.11.1","next":"0.12.0-10"}}