{"id":13739439,"url":"https://github.com/zoubin/tap-summary","last_synced_at":"2025-09-05T10:32:56.435Z","repository":{"id":2483549,"uuid":"46651834","full_name":"zoubin/tap-summary","owner":"zoubin","description":"Summarize TAP","archived":false,"fork":false,"pushed_at":"2022-05-24T08:55:41.000Z","size":940,"stargazers_count":44,"open_issues_count":3,"forks_count":8,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-12-20T17:45:25.772Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zoubin.png","metadata":{"files":{"readme":"README.md","changelog":"changelog.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-11-22T08:06:50.000Z","updated_at":"2023-08-19T03:48:34.000Z","dependencies_parsed_at":"2022-09-02T10:51:33.010Z","dependency_job_id":null,"html_url":"https://github.com/zoubin/tap-summary","commit_stats":null,"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zoubin%2Ftap-summary","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zoubin%2Ftap-summary/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zoubin%2Ftap-summary/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zoubin%2Ftap-summary/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zoubin","download_url":"https://codeload.github.com/zoubin/tap-summary/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":231903731,"owners_count":18443560,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-03T04:00:34.005Z","updated_at":"2024-12-31T23:40:01.782Z","avatar_url":"https://github.com/zoubin.png","language":"JavaScript","funding_links":[],"categories":["Reporters"],"sub_categories":["JavaScript"],"readme":"# tap-summary\n[![version](https://img.shields.io/npm/v/tap-summary.svg)](https://www.npmjs.org/package/tap-summary)\n[![status](https://travis-ci.org/zoubin/tap-summary.svg?branch=master)](https://travis-ci.org/zoubin/tap-summary)\n[![dependencies](https://david-dm.org/zoubin/tap-summary.svg)](https://david-dm.org/zoubin/tap-summary)\n[![devDependencies](https://david-dm.org/zoubin/tap-summary/dev-status.svg)](https://david-dm.org/zoubin/tap-summary#info=devDependencies)\n\nA reporter for TAP.\n\n## Example\n\n![summary](example/clip.gif)\n\n## Usage\n\n### package.json\n```json\n{\n  \"scripts\": {\n    \"test\": \"tape test/*.js | tap-summary\"\n  }\n}\n```\n\n### CLI Options\n\n```\n  --no-ansi        Disable ANSI formatting\n  --no-progress    Disable progress output during tests\n```\n\n### API\n\n```js\nvar summarize = require('tap-summary')\n\nvar fs = require('fs')\nfs.createReadStream('test.tap')\n  .pipe(summarize({\n    ansi: true,\n    progress: true,\n  }))\n  .pipe(process.stdout)\n\n```\n\nAlso, the default formatter could be replaced with custom ones.\n\n```js\nvar reporter = require('tap-summary').reporter()\n\nvar fs = require('fs')\nfs.createReadStream('test.tap')\n  .pipe(customize(reporter))\n  .pipe(process.stdout)\n\n```\n\nThe `reporter` is a `Duplex`,\nwhich consumes the TAP input and output nothing by default.\nHowever, it emits the following events during the process,\nso that `customize` could listen to them and add something into the output.\n\n* reporter.on('test.start', test =\u003e {}).\n  Fired when a new test detected.\n* reporter.on('test.end', test =\u003e {}).\n  Fired when the end of a test reached.\n* reporter.on('test.assert', (assertion, test) =\u003e {}).\n  Fired when a new assertion found.\n* reporter.on('summary', (stats, fails, comments) =\u003e {}). \n  Fired when all TAP input has been processed.\n\nDetails about the `test` and `assertion` object could be found [here][tap-out].\n\nThe `stats` object:\n```js\nvar stats = {\n  // the total time (ms) it takes\n  duration: duration,\n  // the total number of assertions planned\n  planned: res.plans.reduce(function (p, c) {\n    return c.to - c.from + 1 + p;\n  }, 0),\n  // the actual total number of assertions found\n  assertions: res.asserts.length,\n  // the number of successful assertions\n  pass: res.pass.length,\n  // the number of failed assertions\n  fail: res.fail.length,\n  // the number of comments found\n  comments: res.comments.length,\n}\n\n```\n\n`fails` will be `null` unless `stats.fail \u003e 0`:\n```js\n{ \n  testName: [failedAssertion]\n}\n\n```\n\n`comments` will be `null` unless `stats.comments \u003e 0`:\n```js\n{ \n  testName: [comment]\n}\n\n```\n\n[tap-out]: https://github.com/scottcorgan/tap-out\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzoubin%2Ftap-summary","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzoubin%2Ftap-summary","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzoubin%2Ftap-summary/lists"}