{"_id":"@test-runner/tom","_rev":"4-8a607e76aff35fc2e895c2abc506cf1e","name":"@test-runner/tom","dist-tags":{"latest":"0.9.1"},"versions":{"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":{"integrity":"sha512-LVk3B4IzTM2So9sSZF8Dp/xrW2O2U7+Qb9V6krfHSp2ahfp60js3BM6b/kE5ykbefZewT/0bzc+vLHUGxnmS5Q==","shasum":"75e50afa530617b91dbd6aa3cf1720efdf5655db","tarball":"https://registry.npmjs.org/@test-runner/tom/-/tom-0.8.0.tgz","fileCount":7,"unpackedSize":68798,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg4YxUCRA9TVsSAnZWagAAJYkQAJ1u+GjgmeVEgOJjq8Pn\nUHm5Ebm87k5KwcmETXpluhZD0BGWcnGvCSIYMSvRQmAX5Cc4u230cKVpm8J7\n3WdxIlsNzpmzssJ2cdOYNtiUCXOmOnSm9ysNrikPvOy/TbEnbNVG+cva4AI8\nwGcReAJjd5flcv3LjCqXAmPVeS6E6lQD+WtHV4aKmHuTZLscSH5UO3MXCOuD\nwGgSaoGDDEryRK8nUHrMlKEEdxujByQJURF61AHfcL+1vltf5dYsuBzDiAJ0\nlCRG0jNKazBQ+eWfIA9MZAIYNux1BkIAyihTucspy8W9nX+EkYhGCRvfRbov\nAV3gsqP9djRquitw4rWgo7C8EPnG6lEjaPpWrIrOhurWJIynAlhOXlwYrDW0\ncwJKpnxUQ7NkIoXoZsr6o8oBEu/67+xx106WZ7c2PTqulyidAN01RVF/QK9X\nUwJEsDsRyjOv4QIgCEbGOiWzdWgcJk86utrSpefpj3bTyFOU87BhQNd9etjY\ngzxRSJmBVQc5UNBaTQyIr4IWs2lWRUDDXV+XeEdAQWolYY3hq1D9jGZX/cff\nr/NAbt8X/3nPqgyY263JewbmcaT4lqajOgcM7bpEozoLzY0p4jeNw57vZITf\njptSJxbyRq/E7DSQDbiMLKBvUJ4SZHR9/237i8SKJCBt5AxBwtO+icT5WDH5\ngPGe\r\n=Cahg\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCFjkqbifNSio/YsDYNSn1qqKOwXHJxFf3Px0XH3Fcy+QIhANpaHsQryUZ6oQuzEiNaOgsEqKUWR6k4Kz5T+UsFzZ3/"}]},"_npmUser":{"name":"75lb","email":"75pound@gmail.com"},"directories":{},"maintainers":[{"name":"75lb","email":"75pound@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/tom_0.8.0_1625394259682_0.8019073291596179"},"_hasShrinkwrap":false},"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":{"integrity":"sha512-MbQsG8V5R+yU+O9gkL3oidbxk1PNp/j/ctpAXAvbLOdpD+GMan//MBRstFBzLl+n7R9UNvfW3U8eKlnlQ7SNcw==","shasum":"5fc796f0cdf7c8dcb783b11ef37a771b18a28ae6","tarball":"https://registry.npmjs.org/@test-runner/tom/-/tom-0.8.1.tgz","fileCount":7,"unpackedSize":69499,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDk2YnJhaAkwQOl7VV9EvMOBiCd96a9347jw624htZvaAiEA/VGhq/u5L1qWRU9WNIQlI8OkxA1iXrRdVBpn9CtPymo="}]},"_npmUser":{"name":"75lb","email":"75pound@gmail.com"},"directories":{},"maintainers":[{"name":"75lb","email":"75pound@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/tom_0.8.1_1633292287312_0.5735686194377152"},"_hasShrinkwrap":false},"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":{"integrity":"sha512-WU3tW2y7Y0VH8km6T84ZXtdB9xk9d521xyZLGfII57TpQPXlyVPGDd14tUppFXTyOPApFoDzZlbyXz3L854Pgw==","shasum":"7376fb960420e6820ecd3449f7b55ce2fab2374a","tarball":"https://registry.npmjs.org/@test-runner/tom/-/tom-0.9.0.tgz","fileCount":7,"unpackedSize":69158,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCx7ra719/F0RqL/6/i/VVX8vhmF18RKVPIH5VBf6JxuwIhAJ/5gfzqvDMHylhIwQcYuZvUVb5RwxVii1DCiF4ubu5A"}]},"_npmUser":{"name":"75lb","email":"75pound@gmail.com"},"directories":{},"maintainers":[{"name":"75lb","email":"75pound@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/tom_0.9.0_1633813113493_0.8039832527210411"},"_hasShrinkwrap":false},"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":{"integrity":"sha512-kkr+2AcUCsMANLghAiLdWOF8clUe6a3hhsHeDdPyrPVZNMuooqOl/d5bQm1/YK3D0Xm1aiCs3NIPimZcQhzk+g==","shasum":"a977253e89172a250321eb0d81e5a19e1a224fc1","tarball":"https://registry.npmjs.org/@test-runner/tom/-/tom-0.9.1.tgz","fileCount":7,"unpackedSize":69158,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh4e7MCRA9TVsSAnZWagAA6N8P/0fDjRSNXrobSNkgncth\nrNmsqGYAQ73AQ/+K/nZLce1yy1BnSLXQMx2aJS9n37mI4xsIQWarNd+U1Y/u\nyjGaCP09g07fN3Q+Rq4oqDAz+LJOVXOWhU8KW64E5IyDt+lLCqN9OuHV14m1\nuziJKxu49H17t9w79StP7i9NHTvYt649E1SXFn8DDeQOPSV1dVBw4kgwTji0\nlxp9wsbiYd1/Mnl4EQOPsX2H74i10hLtpcBZ2gYiCCiZzd1ihIwcI7PZoc4C\nQMYcYLaXv090+9TRJx23A4s140WXBnCIaLip2aHrJqqz/9iqix5CV7Gm8udZ\n/V+jvJPdadGVlYqhuEanf2dvzf3HFA39TN2PssyvRABsxkH/Qe8HUvyuN2Bb\nuyVQFZ3W/mNO0TwBeTAvgPVtvroLG0IpCvq6X8l1vm9T9ZstW91VxiWiXc+A\n/1OvamHw/LmsQP/A8AoXygr2r80hCauHJAh+upOghpMCdj463GMCdf3qh0Bv\nSYGMor5p5A7XVK0tVpO/QIildvnodbpB/hltemrH+ZXIt+iSusOtN2x93oeV\nAKjWW0Vj/olj5QsJXsmnwZIJIybRRuskvrEOZayBFSq7F5qCdi5trnifjncF\nZjlxdzEq5Vxgr8dw1sLdbuzM1Vqv9TX8YmM/Pz8gU6SWt9D40hubz7KD+stQ\nuoq+\r\n=VXwP\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHSxpkoBcAyfdWiOoGqgBMTMSQJowOp6VkY8KvOg5V9PAiApSASSQ274zYFGWN22QAmG7w70uayYf/HIUqzrOuLGhQ=="}]},"_npmUser":{"name":"75lb","email":"75pound@gmail.com"},"directories":{},"maintainers":[{"name":"75lb","email":"75pound@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/tom_0.9.1_1642196684589_0.6976021106187216"},"_hasShrinkwrap":false}},"time":{"created":"2021-07-04T10:24:19.474Z","0.8.0":"2021-07-04T10:24:19.819Z","modified":"2022-04-07T05:21:02.970Z","0.8.1":"2021-10-03T20:18:07.455Z","0.9.0":"2021-10-09T20:58:33.682Z","0.9.1":"2022-01-14T21:44:44.720Z"},"maintainers":[{"name":"75lb","email":"75pound@gmail.com"}],"description":"Define a Test Object Model","homepage":"https://github.com/test-runner-js/tom#readme","keywords":["test-runner","test","testing","suite","runner","model","test-object-model"],"repository":{"type":"git","url":"git+https://github.com/test-runner-js/tom.git"},"author":{"name":"Lloyd Brookes","email":"75pound@gmail.com"},"bugs":{"url":"https://github.com/test-runner-js/tom/issues"},"license":"MIT","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","readmeFilename":"README.md"}