{"_id":"@test-runner/core","_rev":"1-5b3ff1f1e664a09b34c62c1fd0144089","name":"@test-runner/core","dist-tags":{"latest":"0.10.0"},"versions":{"0.10.0":{"name":"@test-runner/core","author":{"name":"Lloyd Brookes","email":"75pound@gmail.com"},"version":"0.10.0","description":"Minimal, extensible, isomorphic test runner.","repository":{"type":"git","url":"git+https://github.com/test-runner-js/core.git"},"exports":{"import":"./index.mjs","require":"./dist/index.cjs"},"license":"MIT","keywords":["test","runner","minimal","simple","easy","tape","tap","ava","mocha"],"engines":{"node":">=14"},"scripts":{"test":"npm run dist && test-runner --view.hide-skips test/*.mjs","dist":"rollup -c","watch":"rollup -cw","docs":"jsdoc2md -c jsdoc.conf index.mjs > docs/API.md && jsdoc2md -c jsdoc.conf lib/view.mjs > docs/view.md"},"dependencies":{"@test-runner/tom":"^0.8.0","fsm-base":"^0.7.0"},"devDependencies":{"@rollup/plugin-node-resolve":"^13.0.0","isomorphic-assert":"^0.2.0","jsdoc-to-markdown":"^7.0.1","node-fetch":"^2.6.1","rollup":"^2.52.7","sleep-anywhere":"^1.1.3","test-runner":"^0.9.5"},"standard":{"ignore":["tmp","dist"]},"gitHead":"3821ee47a7667ba4e634d3bfd1522f319581cfad","bugs":{"url":"https://github.com/test-runner-js/core/issues"},"homepage":"https://github.com/test-runner-js/core#readme","_id":"@test-runner/core@0.10.0","_nodeVersion":"16.4.1","_npmVersion":"7.19.1","dist":{"integrity":"sha512-1m+DowKsEa4IAShyvwj58b9AfbCgZxf9ynPRGixsIzUY03zSEdNB2ItfjMtDPNmoPgbZVxX0DgTgbNfgwRrJQA==","shasum":"e6551e31872b7a9ba09dea8753deebc6fb4558e7","tarball":"https://registry.npmjs.org/@test-runner/core/-/core-0.10.0.tgz","fileCount":9,"unpackedSize":83484,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg4Y4ICRA9TVsSAnZWagAAzDkP/1G+GDRDbKVhIlUcQMVs\nDYbUv8D0r+fpOEyWlK7x28YiMvn3NwNBzxTvn3X083CQvvTgu9Ir3fF8o5Vx\nPi0/bLvjcecVOM3lFRD0kP2q4hIavi2o3K4E73w155MTU4AaHCWmIdOaNU3H\ncjlruqMlI9LhSKGFJ+GM5AcNKql+6Kpq/QsEK19W/NvZil9FoaoZsQ5yKuco\nrPr1BeTz3S/RppdtoAZk28xBqpSwpXE6m5EUJoIk0gi/b0wKoEFI4LKQA0Ko\nhzocHaPIDqKZOAYxxCFpAz5V5OvOxi3ueSmHLyjgF/4yhjr3i7mIJpqvY+zk\nH36Mwyl0GuoPIAosLod/Mf+tIBk01EXihCz4V2/Zz2pON4kFOQVRj+bLQuI4\n+C9SpnSsdscFaZTkJnWF0tuBgh4G9OESWWaBoEkU5HwpoxGljTLN6Xxndlf6\nPLGrFhTO6kGGidZaf/Pk4G4nIkINlv926Yu/qsKozxvyEiJU5IM1aNtM2M1q\nCWiGLwsBcVZZrjf5lQ30iBerEcTVuVsuVGb2CQAGI7YH3uIP3Z87SprL0Lyw\nPy0jyVBFk7d37xrqTMpfLvHDTUwgse7JT2Nqdx1flp4arAmwDsSZafFxTkHp\n+1bx3S1amolV+T5Nxgm2r18xENLy7wr0LQ6obF5PGd44R2BOfQdrwmPp+Lrm\nA7ZY\r\n=9C2J\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIG792RVVZKu63PGOG5r775+yO2alc8oYCqz9Gv8b2CK/AiEA3UD84dmLJonyGMzxSjwEWPmPzcTjt6pLlV8kVgxs7hw="}]},"_npmUser":{"name":"75lb","email":"75pound@gmail.com"},"directories":{},"maintainers":[{"name":"75lb","email":"75pound@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/core_0.10.0_1625394695631_0.27642142713682594"},"_hasShrinkwrap":false}},"time":{"created":"2021-07-04T10:31:35.400Z","0.10.0":"2021-07-04T10:31:35.760Z","modified":"2022-04-07T05:21:01.660Z"},"maintainers":[{"name":"75lb","email":"75pound@gmail.com"}],"description":"Minimal, extensible, isomorphic test runner.","homepage":"https://github.com/test-runner-js/core#readme","keywords":["test","runner","minimal","simple","easy","tape","tap","ava","mocha"],"repository":{"type":"git","url":"git+https://github.com/test-runner-js/core.git"},"author":{"name":"Lloyd Brookes","email":"75pound@gmail.com"},"bugs":{"url":"https://github.com/test-runner-js/core/issues"},"license":"MIT","readme":"[![view on npm](https://badgen.net/npm/v/@test-runner/core)](https://www.npmjs.org/package/@test-runner/core)\n[![npm module downloads](https://badgen.net/npm/dt/@test-runner/core)](https://www.npmjs.org/package/@test-runner/core)\n[![Gihub repo dependents](https://badgen.net/github/dependents-repo/test-runner-js/core)](https://github.com/test-runner-js/core/network/dependents?dependent_type=REPOSITORY)\n[![Gihub package dependents](https://badgen.net/github/dependents-pkg/test-runner-js/core)](https://github.com/test-runner-js/core/network/dependents?dependent_type=PACKAGE)\n[![Node.js CI](https://github.com/test-runner-js/core/actions/workflows/node.js.yml/badge.svg)](https://github.com/test-runner-js/core/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/core\n\n***This documentation is a work in progress.***\n\nIsomophic test runner. Takes a test-object-model instance as input, streaming progress info to the attached view or listener. Used by test-runner and web-runner.\n\n## Synopsis\n\nThis trivial example creates a test object model containing one passing and one failing test. The model is passed to a `TestRunnerCore` instance, along with the default view, which then runs the tests printing the result to the console.\n\n```js\nimport TestRunnerCore from '@test-runner/core'\nimport Tom from '@test-runner/tom'\n\n/* Define a simple test model */\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\n/* send test-runner output to the default view  */\nconst view = new DefaultView()\n\n/* run the tests defined in the test model */\nconst runner = new TestRunnerCore(tom, { view })\nrunner.start()\n```\n\nOutput.\n\n```\n$ nodem tmp/synopsis.mjs\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> (file:///Users/lloyd/Documents/test-runner-js/core/tmp/synopsis.mjs:13:9)\n       ...\n       at processTimers (internal/timers.js:475:7)\n\n\nCompleted in 11ms. Pass: 1, fail: 1, skip: 0.\n```\n\nInstead of passing a `view` instance to `TestRunnerCore`, this example shows how to observe `runner` events and print your own output.\n\n```js\nconst runner = new TestRunnerCore(tom)\n\nrunner.on('state', (state, prevState) => {\n  console.log(`Runner state change: ${prevState} -> ${state}`)\n})\nrunner.on('test-pass', test => {\n  console.log(`Test passed: ${test.name}`)\n})\nrunner.on('test-fail', test => {\n  console.log(`Test failed: ${test.name}`)\n})\nrunner.start().then(() => {\n  console.log(`Test run complete. State: ${runner.state}, passed: ${runner.stats.pass}, failed: ${runner.stats.fail}`)\n})\n```\n\nOutput.\n\n```\n$ node --experimental-modules synopsis.mjs\nRunner state change: pending -> in-progress\nTest passed: A successful test\nTest failed: A failing test\nRunner state change: in-progress -> fail\nTest run complete. State: fail, passed: 1, failed: 1\n```\n\n## See also\n\n* [API docs](https://github.com/test-runner-js/core/blob/master/docs/API.md)\n\n* * *\n\n&copy; 2016-21 Lloyd Brookes \\<75pound@gmail.com\\>. Documented by [jsdoc-to-markdown](https://github.com/jsdoc2md/jsdoc-to-markdown).\n","readmeFilename":"README.md"}