{"name":"treport","description":"Reporters for node-tap","version":"0.4.2","author":{"name":"Isaac Z. Schlueter","email":"i@izs.me","url":"https://izs.me"},"dependencies":{"cardinal":"^2.1.1","chalk":"^2.4.2","import-jsx":"^2.0.0","ink":"^2.1.1","ms":"^2.1.1","react":"^16.8.6","string-length":"^2.0.0","tap-parser":"^10.0.1","unicode-length":"^2.0.1"},"devDependencies":{"events-to-array":"^1.1.2","ink-testing-library":"^1.0.1","minipass":"^3.0.0","tap":"^14.7.1"},"license":"ISC","scripts":{"test":"tap","snap":"tap","preversion":"npm test","postversion":"npm publish","postpublish":"git push origin --all; git push origin --tags"},"tap":{"check-coverage":true,"test-env":["TERM_PROGRAM=iTerm.app","TERM=xterm-256color","TERM_PROGRAM_VERSION=3.2.7","COLORTERM=truecolor","FORCE_COLOR=1"],"coverage-map":"map.js"},"nyc":{"all":true,"include":["index.js","lib/**/!(*.test).js"]},"main":"index.js","repository":{"type":"git","url":"git://github.com/tapjs/treport.git"},"gitHead":"507f5414ce4fa5e72bf532707bc60b290768c529","bugs":{"url":"https://github.com/tapjs/treport/issues"},"homepage":"https://github.com/tapjs/treport#readme","_id":"treport@0.4.2","_nodeVersion":"12.12.0","_npmVersion":"6.12.0","dist":{"integrity":"sha512-Po8pQ/rmu4lVNmZWBgqyiHoIWXFeWaMA3H/WoCKw+DiS0xFn43UYRH6hYnjmrWCp0rkLItELQP/maO9uHDe/7A==","shasum":"27574ef8e7b534bd1a4feedc75b6c19044117472","tarball":"http://registry-npm.ywwl.com/treport/download/treport-0.4.2.tgz","fileCount":33,"unpackedSize":43484,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdqSNmCRA9TVsSAnZWagAAPzYP/0pRuAaBvpagtv3pEtsl\ngxIsnyu/XvYHKdnrWDCmGnriGt1I6XJYT1gkkbLUIm+77/rC8H2OIxqJKhbB\n6q8DTnh0F89h7MmzNwEXLBc63oo4KVdSvo6oRlQWupDGqWJLdGctl63NLe+5\n94QmVz5xK7VTKMIKFWv3lZXIwnFUHj0z9tXfKLc443y37eMc30Us/OP9Nj2Q\nTeU13d/ftFmO2eXPydcR4YVmy8tbxWoVjy0QtdS7wDwFchWKWN8ydtcSdvOU\nivoz1Kz2I+0Vr+PQYJDNSANxr7AUigsTQj3S/pfAtLnT8Avpq2nTd3xSDGmT\nHUxoRu1IuyPKk9ov3D1qwGKN4UFWCLeAmBSK4Z/tyb9V7mzw9KPavc9V11pD\n2rFz1FiLEbwUcWplcmbLiWQhkXcfur+KpsmveEzHBzzPCF+TeMuWBdDGIWl1\nD7G4Z1fKk+9v2DsYeCtmB3XEXsUQE63grLPqmsdhKtZ/aAuai4DbKyZLY9Ov\nWa9suEyFi15lceyAwE0B2BRKsBfkjBjYUdYYdPrNOgVb0TgEccplLMLCYYf/\nxz9hjJBfNMNtgf8zBScnx4887YvEzzOxiKzsPHjxDM1j7F8wFIzSPsc8VfB9\n5y23T3O5TVabcB0rcQL8pF7OeOaQl6KrTe4TSZLOZsbizjAjdZi2GLkTVPNk\njkX5\r\n=uD8J\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCAFxoi/Lj8A6zh0oHHRFkhnXl49mcHOw8KthxvyWm1/QIhAP475e4S96ZtEkP/7o7D/th2ReH8yLnHL7CS8mrudgRa"}],"size":12897,"noattachment":false,"key":"/treport/-/treport-0.4.2.tgz"},"maintainers":[{"name":"isaacs","email":"i@izs.me"}],"_npmUser":{"name":"isaacs","email":"i@izs.me"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/treport_0.4.2_1571365733902_0.6670130650531858"},"_hasShrinkwrap":false,"readme":"# treporter\n\nReporters for node-tap\n\nAn [ink](http://npm.im/ink)-based reporter for use with\n[tap](http://npm.im/tap) version 13 and higher.\n\n## Built-in Report Types\n\n### Base\n\nThe default, and the class to extend to create new reporters.  Does all the\nthings, handles all the edge cases, and ends with a pleasant surprise.\n\n### Terse\n\nA lot like Base, but says a lot less.  No timer, no list of tests concurrently\nrunning, nothing printed on test passing.  Just the failures and the terse\nsummary.\n\n### Specy\n\nA `spec` style reporter with the current running jobs and Terse summary and\nfooter.\n\n## Extending\n\nYou can extend this by creating a module whose main `module.exports` is a\nchild class that extends the `treport.Base` class (which in turn extends\n`React.Component`).\n\n```js\nconst React = require('react')\nconst {Base} = require('treport')\nclass MyTreportBasedTapReporter extends Base {\n  // my stuff...\n}\nmodule.exports = MyTreportBasedTapReporter\n```\n\nTo use your module as the test reporter, you'd do this:\n\n```\nnpm install -D my-treport-based-tap-reporter\ntap --reporter=my-treport-based-tap-reporter\n```\n\nTap will `require()` that module, see it's a `React.Component`, and use it\nwith ink.\n\nYour child class will get its `constructor()` called with `{tap:tap}`,\nwhich is the root tap object for the test runner.\n\nIt can override the `render()` method, or anything else.  In most cases, you\nwill likely want to override just part of the class, or one of the tags used\nfor the layout, but the sky is the limit.  A child class could also modify the\ndata being tracked, but leave the tags untouched.\n\nThe following methods describe each of the class methods that can be\noverridden.\n\n### render()\n\nThe main rendering entry point, as is the React custom.  The Base class\nreturns:\n\n```jsx\n<Box flexDirection=\"column\">\n  <this.Log log={this.state.log} />\n  <this.Runs runs={this.state.runs} />\n  { this.state.results ? (\n      <this.Summary\n        results={this.state.results}\n        tests={this.state.tests} />\n    )\n    : '' }\n  <this.Footer\n    suiteCounts={suiteCounts}\n    assertCounts={assertCounts}\n    time={time} />\n</Box>\n```\n\nOne of the easiest ways to change the look and feel of the test reporter is to\nswap out these components.\n\n### get Log()\n\nA getter function that returns the React component for the \"log\" section.  This\nsection gets failure/todo/skip results pushed into it, as well as the final\npass/fail/todo/skip result for tests when they complete.  Typically, it should\nuse a `<Static>` tag, since this will often get much longer than the height of\nthe terminal window, and you want to be able to see the results.\n\nSee `state.log` below for more info.\n\n### get Runs()\n\n- `runs` Array of Test objects\n\nA getter function that returns the React component for the \"runs\" section.\n`this.state.runs` is a list of the tests currently in progress.\n\n### get Summary()\n\nThis is a section that shows when the test run is fully completed.  It shows a\npretty banner with rainbows, along with any tests that failed, or are marked as\nskip or todo.\n\n### get Footer()\n\nThis is a section that shows the count of test suites (ie, processes) queued\nand completed, a count of assertions completed, and a timer so you can see how\nlong the test is running for.\n\n## State Properties\n\nThe reporter keeps the following state properties up to date as the test\nproceeds:\n\n### this.state.log\n\nArray of log objects.  Each is one of the following types:\n\n- `{ raw: <String> }` just a plain old string.\n- `{ res: {ok, name, diag, todo, skip, testName} }` A test point\n- `{ test: [Test Object] }` A test that has completed\n\n### this.state.tests\n\nAll tests are added to this array.  In the event of a bailout, everything other\nthan the bailing-out test is removed, so that the Summary output isn't\ncluttered up with a bunch of spurious failures.\n\n### this.state.runs\n\nArray of tests currently running.  (When not running in parallel mode, this is\nalways a single item.)\n\n### this.state.results\n\nThe `tap.results` object at the end of the test run.\n\n### this.state.assertCounts\n\nCounts of all assertions run in all tests. `{total, pass, fail, skip, todo}`\n\nIn order to avoid overwhelming the display, updates to assertion counts are\ndebounced so that they are not updated more than once every 50ms.\n\n### this.state.suiteCounts\n\nJust like `assertCounts`, but for test suites, and not debounced.\n\n### this.state.time\n\nTotal elapsed time in ms since the test run started.\n\n### this.state.bailout\n\nWhen a bailout occurs, this is set to the bailout reason, or `true` if no\nreason is given.\n\n### this.start\n\nThe `Date.now()` when the test run started.\n\n### this.assertCounts\n\nUpdated on each test assertion.  Matched to `this.state.assertCounts` at most\nonce every 50ms.\n\n### constructor()\n\nThe constructor receives `tap` as an argument, initializes state, and assigns\nappropriate event handlers to keep state up to date.  Then, the\n`this.tapResume(tap)` method is called to resume and discard the TAP output\nfrom the test harness, since the reporter gets everything it needs from the\nevents and child test objects.\n\n### tapResume(tap)\n\nOverride to prevent the `tap` object from being resumed when calling the Base\nconstructor.\n\n### get time()\n\nCalled to get the current running time.\n\n### bailout(bailout, test = null)\n\nCalled when a test bails out.  If `test` is set to null, then that means that\nthe root Tap test is bailing out independently of any child test.  (This is\nunusual.)\n\n### inc(type)\n\nCalled on each assertion to increment `this.assertCounts` and\n`this.state.assertCounts`.\n\n### addTest(test)\n\nCalled whenever a new test is added to the queue (but before it has started\nrunning).\n\n### startTest(test)\n\nCalled when a test starts.\n\n### endTest(test)\n\nCalled when a test ends.\n\n### endAll(tap)\n\nCalled when the main all tests are done and the tap test runner completes.\n\n### logRes(test, res)\n\nCalled when a fail/todo/skip result is emitted from a test, and pushes it onto\nthe log.\n\n### onRaw(test, fd)\n\nReturns a handler to take all the non-TAP data from a child test, so that it\ncan be printed to the log with a helpful prefix.  In the Base test class, this\nprefixes with the name of the test and the file descriptor printed to.\n\nSo, for example, a test named `test/foo.js` would have its stderr output\nprefixed with `test/foo.js 2> ...` and its stdout output prefixed with\n`test/foo.js 1> ...`.\n","publish_time":1571365734084,"_cnpm_publish_time":1571365734084,"dist-tags":{"latest":"3.0.4"}}