{"_id":"@test-runner/tom","_rev":"267012","name":"@test-runner/tom","description":"Define a Test Object Model","dist-tags":{"latest":"0.9.1"},"maintainers":[{"name":"75lb","email":""}],"time":{"modified":"2023-03-27T19:06:57.000Z","created":"2021-07-04T10:24:19.819Z","0.9.1":"2022-01-14T21:44:44.720Z","0.9.0":"2021-10-09T20:58:33.682Z","0.8.1":"2021-10-03T20:18:07.455Z","0.8.0":"2021-07-04T10:24:19.819Z"},"users":{},"author":{"name":"Lloyd Brookes","email":"75pound@gmail.com"},"repository":{"type":"git","url":"git+https://github.com/test-runner-js/tom.git"},"versions":{"0.9.1":{"name":"@test-runner/tom","author":{"name":"Lloyd Brookes","email":"75pound@gmail.com"},"version":"0.9.1","description":"Define a Test Object Model","repository":{"type":"git","url":"git+https://github.com/test-runner-js/tom.git"},"type":"module","exports":{"import":"./index.js","require":"./dist/index.cjs"},"keywords":["test-runner","test","testing","suite","runner","model","test-object-model"],"license":"MIT","engines":{"node":">=12.17"},"scripts":{"test":"npm run dist && npm run test:ci","test:ci":"test-runner --view.hide-skips test/*.js","test:web":"web-runner test/*.js","dist":"rollup -c","docs":"jsdoc2md index.js lib/*.js > docs/API.md"},"dependencies":{"composite-class":"^2.0.1","create-mixin":"^3.0.0","fsm-base":"^0.7.0","race-timeout-anywhere":"^2.0.0","typical":"^7.1.1"},"devDependencies":{"@rollup/plugin-node-resolve":"^13.1.3","isomorphic-assert":"^1.0.0","jsdoc-to-markdown":"^7.1.0","rollup":"^2.64.0","sleep-anywhere":"^2.1.0","test-runner":"^0.10.0"},"standard":{"ignore":["tmp","dist"]},"gitHead":"9abd691f0280ce8609bd673bcca2ba3e9786b355","bugs":{"url":"https://github.com/test-runner-js/tom/issues"},"homepage":"https://github.com/test-runner-js/tom#readme","_id":"@test-runner/tom@0.9.1","_nodeVersion":"17.3.1","_npmVersion":"8.3.0","dist":{"shasum":"a977253e89172a250321eb0d81e5a19e1a224fc1","size":15839,"noattachment":false,"key":"/@test-runner/tom/-/@test-runner/tom-0.9.1.tgz","tarball":"http://name.csiicloud.com:7001/@test-runner/tom/download/@test-runner/tom-0.9.1.tgz"},"_npmUser":{"name":"75lb","email":"75pound@gmail.com"},"directories":{},"maintainers":[{"name":"75lb","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/tom_0.9.1_1642196684589_0.6976021106187216"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2022-01-14T21:44:54.023Z","publish_time":1642196684720,"_cnpm_publish_time":1642196684720},"0.9.0":{"name":"@test-runner/tom","author":{"name":"Lloyd Brookes","email":"75pound@gmail.com"},"version":"0.9.0","description":"Define a Test Object Model","repository":{"type":"git","url":"git+https://github.com/test-runner-js/tom.git"},"type":"module","exports":{"import":"./index.js","require":"./dist/index.cjs"},"keywords":["test-runner","test","testing","suite","runner","model","test-object-model"],"license":"MIT","engines":{"node":">=12.17"},"scripts":{"test":"npm run dist && npm run test:ci","test:ci":"test-runner --view.hide-skips test/*.js","test:web":"web-runner test/*.js","dist":"rollup -c","docs":"jsdoc2md index.js lib/*.js > docs/API.md"},"dependencies":{"composite-class":"^2.0.1","create-mixin":"^3.0.0","fsm-base":"^0.7.0","race-timeout-anywhere":"^2.0.0","typical":"^7.1.1"},"devDependencies":{"@rollup/plugin-node-resolve":"^13.0.5","isomorphic-assert":"^1.0.0","jsdoc-to-markdown":"^7.0.1","rollup":"^2.58.0","sleep-anywhere":"^2.1.0","test-runner":"^0.10.0"},"standard":{"ignore":["tmp","dist"]},"gitHead":"e6163231b28a1216c63de17012e6073409a2465f","bugs":{"url":"https://github.com/test-runner-js/tom/issues"},"homepage":"https://github.com/test-runner-js/tom#readme","_id":"@test-runner/tom@0.9.0","_nodeVersion":"16.10.0","_npmVersion":"7.24.0","dist":{"shasum":"7376fb960420e6820ecd3449f7b55ce2fab2374a","size":15840,"noattachment":false,"key":"/@test-runner/tom/-/@test-runner/tom-0.9.0.tgz","tarball":"http://name.csiicloud.com:7001/@test-runner/tom/download/@test-runner/tom-0.9.0.tgz"},"_npmUser":{"name":"75lb","email":"75pound@gmail.com"},"directories":{},"maintainers":[{"name":"75lb","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/tom_0.9.0_1633813113493_0.8039832527210411"},"_hasShrinkwrap":false,"publish_time":1633813113682,"_cnpm_publish_time":1633813113682,"_cnpmcore_publish_time":"2021-12-14T06:59:43.152Z"},"0.8.1":{"name":"@test-runner/tom","author":{"name":"Lloyd Brookes","email":"75pound@gmail.com"},"version":"0.8.1","description":"Define a Test Object Model","repository":{"type":"git","url":"git+https://github.com/test-runner-js/tom.git"},"type":"module","exports":{"import":"./index.js","require":"./dist/index.cjs"},"keywords":["test-runner","test","testing","suite","runner","model","test-object-model"],"license":"MIT","engines":{"node":">=12.17"},"scripts":{"test":"npm run dist && npm run test:ci","test:ci":"test-runner --view.hide-skips test/*.js","test:web":"web-runner test/*.js","dist":"rollup -c","docs":"jsdoc2md index.js lib/*.js > docs/API.md","c8":"c8 --reporter=html npm test"},"dependencies":{"composite-class":"^2.0.1","create-mixin":"^3.0.0","fsm-base":"^0.7.0","race-timeout-anywhere":"^2.0.0","typical":"^7.1.1"},"devDependencies":{"@rollup/plugin-node-resolve":"^13.0.5","c8":"^7.9.0","isomorphic-assert":"^1.0.0","jsdoc-to-markdown":"^7.0.1","rollup":"^2.58.0","sleep-anywhere":"^2.1.0","test-runner":"^0.9.8"},"standard":{"ignore":["tmp","dist"]},"gitHead":"7242c2efd9617a84406f261cde6de469157f8558","bugs":{"url":"https://github.com/test-runner-js/tom/issues"},"homepage":"https://github.com/test-runner-js/tom#readme","_id":"@test-runner/tom@0.8.1","_nodeVersion":"16.10.0","_npmVersion":"7.24.1","dist":{"shasum":"5fc796f0cdf7c8dcb783b11ef37a771b18a28ae6","size":15510,"noattachment":false,"key":"/@test-runner/tom/-/@test-runner/tom-0.8.1.tgz","tarball":"http://name.csiicloud.com:7001/@test-runner/tom/download/@test-runner/tom-0.8.1.tgz"},"_npmUser":{"name":"75lb","email":"75pound@gmail.com"},"directories":{},"maintainers":[{"name":"75lb","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/tom_0.8.1_1633292287312_0.5735686194377152"},"_hasShrinkwrap":false,"publish_time":1633292287455,"_cnpm_publish_time":1633292287455,"_cnpmcore_publish_time":"2021-12-14T06:59:43.359Z"},"0.8.0":{"name":"@test-runner/tom","author":{"name":"Lloyd Brookes","email":"75pound@gmail.com"},"version":"0.8.0","description":"Define a Test Object Model","repository":{"type":"git","url":"git+https://github.com/test-runner-js/tom.git"},"exports":{"import":"./index.mjs","require":"./dist/index.cjs"},"keywords":["test-runner","test","testing","suite","runner","model","test-object-model"],"license":"MIT","engines":{"node":">=14"},"scripts":{"test":"npm run dist && npm run test:esm","test:esm":"test-runner --view.hide-skips test/*.mjs","test:web":"web-runner test/*.mjs","dist":"rollup -c","docs":"jsdoc2md -c jsdoc.conf index.mjs lib/*.mjs > docs/API.md","c8":"c8 --reporter=html npm test"},"dependencies":{"composite-class":"^2.0.1","create-mixin":"^3.0.0","fsm-base":"^0.7.0","race-timeout-anywhere":"^2.0.0","typical":"^7.0.0"},"devDependencies":{"@rollup/plugin-node-resolve":"^13.0.0","c8":"^7.7.3","isomorphic-assert":"^0.2.0","jsdoc-to-markdown":"^7.0.1","rollup":"^2.52.7","sleep-anywhere":"^1.1.3","test-runner":"^0.9.5"},"standard":{"ignore":["tmp","dist"]},"gitHead":"62c33fc0a89d02da89f1d5d6b619bb938ce9bf58","bugs":{"url":"https://github.com/test-runner-js/tom/issues"},"homepage":"https://github.com/test-runner-js/tom#readme","_id":"@test-runner/tom@0.8.0","_nodeVersion":"16.4.1","_npmVersion":"7.19.1","dist":{"shasum":"75e50afa530617b91dbd6aa3cf1720efdf5655db","size":14744,"noattachment":false,"key":"/@test-runner/tom/-/@test-runner/tom-0.8.0.tgz","tarball":"http://name.csiicloud.com:7001/@test-runner/tom/download/@test-runner/tom-0.8.0.tgz"},"_npmUser":{"name":"75lb","email":"75pound@gmail.com"},"directories":{},"maintainers":[{"name":"75lb","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/tom_0.8.0_1625394259682_0.8019073291596179"},"_hasShrinkwrap":false,"publish_time":1625394259819,"_cnpm_publish_time":1625394259819,"_cnpmcore_publish_time":"2021-12-14T06:59:43.569Z"}},"readme":"[![view on npm](https://badgen.net/npm/v/@test-runner/tom)](https://www.npmjs.org/package/@test-runner/tom)\n[![npm module downloads](https://badgen.net/npm/dt/@test-runner/tom)](https://www.npmjs.org/package/@test-runner/tom)\n[![Gihub repo dependents](https://badgen.net/github/dependents-repo/test-runner-js/tom)](https://github.com/test-runner-js/tom/network/dependents?dependent_type=REPOSITORY)\n[![Gihub package dependents](https://badgen.net/github/dependents-pkg/test-runner-js/tom)](https://github.com/test-runner-js/tom/network/dependents?dependent_type=PACKAGE)\n[![Node.js CI](https://github.com/test-runner-js/tom/actions/workflows/node.js.yml/badge.svg)](https://github.com/test-runner-js/tom/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/tom\n\n***This project and documentation are a work in progress***.\n\nA TOM (Test Object Model) is a data structure that defines a test suite in the same way a DOM defines a web document. The model describes your tests, how they are grouped, the order in which they should run and the config for each (timeout, max concurrency etc.)\n\nOnce defined, a TOM can be executed by a compatible runner, for example: [test-runner](https://github.com/test-runner-js/cli) or [web-runner](https://github.com/test-runner-js/web-runner).\n\n## Synopsis\n\nTrivial example building a TOM containing two tests - one pass and one fail. A test is created by supplying a name and function to `tom.test`. Later, when executed by the runner, if the function throws or rejects then the test is considered a fail.\n\n```js\nimport Tom from '@test-runner/tom'\nconst tom = new Tom()\n\ntom.test('A successful test', function () {\n  return 'This passed'\n})\n\ntom.test('A failing test', function () {\n  throw new Error('This failed')\n})\n\nexport default tom\n```\n\nSave the above to file named `test.js`, you can now run this test suite in several ways. For example, you can run it in Node.js by supplying it as input to [test-runner](https://github.com/test-runner-js/test-runner).\n\n```\n$ test-runner test.js\n\nStart: 2 tests loaded\n\n✓ synopsis A successful test [This passed]\n⨯ synopsis A failing test\n\n   Error: This failed\n       at TestContext.<anonymous> (file:///Users/lloyd/Documents/test-runner-js/tom/tmp/synopsis.mjs:10:9)\n       ...\n       at processTimers (internal/timers.js:475:7)\n\n\nCompleted in 10ms. Pass: 1, fail: 1, skip: 0.\n```\n\nOr, to verify the code under test is isomorphic, you can run the same TOM in the browser (Chromium) using [web-runner](https://github.com/test-runner-js/web-runner).\n\n\n```\n$ web-runner test.js\n\nStart: 2 tests loaded\n\n✓ tom A successful test [This passed]\n⨯ tom A failing test\n\n   Error: This failed\n       at TestContext.<anonymous> (http://localhost:7357/output.mjs:894:9)\n       ...\n       at http://localhost:7357/output.mjs:2016:21\n\n\nCompleted in 8ms. Pass: 1, fail: 1, skip: 0.\n```\n\n## API summary\n\nSupply a name and test function to `tom.test`. If the function throws or rejects the test is considered a fail.\n\n```js\ntom.test('name', function () {\n  // test\n})\n```\n\nSkip a test. You can revisit this test later.\n\n```js\ntom.skip('name', function () {\n  // test\n})\n```\n\nSkip all but this and any other tests marked as `only`.\n\n```js\ntom.only('name', function () {\n  // test\n})\n```\n\nCreate a sub-group.\n\n```js\nconst groupOne = tom.group('My group')\n\ngroupOne.test('first test in the group', function () {\n  // test\n})\n```\n\nDefine tests to be run before and after the main tests in the group.\n\n```js\ntom.before('name', function () {\n  // test\n})\n\ntom.after('name', function () {\n  // test\n})\n\n```\n\nTodo. This will highlighted in test results to remind you to revisit it later.\n\n```js\ntom.todo('name', function () {\n  // Complete later\n})\n```\n\nReset a completed test, ready to run again.\n\n```js\ntom.reset()\n```\n\n\n## Documentation\n\n* [API reference](https://github.com/test-runner-js/tom/blob/master/docs/API.md)\n\n* * *\n\n&copy; 2018-21 Lloyd Brookes \\<75pound@gmail.com\\>.\n\n","_attachments":{},"homepage":"https://github.com/test-runner-js/tom#readme","bugs":{"url":"https://github.com/test-runner-js/tom/issues"},"license":"MIT"}