{"id":16244611,"url":"https://github.com/indexzero/tap-flattener","last_synced_at":"2025-04-08T11:20:16.424Z","repository":{"id":57147881,"uuid":"100143784","full_name":"indexzero/tap-flattener","owner":"indexzero","description":"Flattens tap output including subtests into a single level hierarchy","archived":false,"fork":false,"pushed_at":"2017-08-15T00:59:52.000Z","size":19,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-10-18T21:04:07.091Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/indexzero.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-08-13T00:02:01.000Z","updated_at":"2024-07-03T09:11:31.000Z","dependencies_parsed_at":"2022-09-06T15:02:31.984Z","dependency_job_id":null,"html_url":"https://github.com/indexzero/tap-flattener","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/indexzero%2Ftap-flattener","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/indexzero%2Ftap-flattener/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/indexzero%2Ftap-flattener/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/indexzero%2Ftap-flattener/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/indexzero","download_url":"https://codeload.github.com/indexzero/tap-flattener/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247829518,"owners_count":21002997,"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-10-10T14:19:56.297Z","updated_at":"2025-04-08T11:20:16.406Z","avatar_url":"https://github.com/indexzero.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# tap-flattener\n\nFlattens tap output including subtests into a single level hierarchy. Conforms to the same API and guarantees as `tap-parser`\n\n## Motivation\n\nThere are cases for TAP interop with other platforms where the entirety of the [TAP 13] specification are not implemented. Specifically that subtests may not be supported given the [many flavors][subtests] possible. It is, however, also possible to \"flatten\" tap-output with subtests. e.g.:\n\n```\n$ cat test/fixtures/subtests.tap\nTAP version 13\n# Subtest: addition\n    ok 1 - 1 + 2 = 3\n    ok 2 - 5 + 5 = 10\n    ok 3 - 1 + 0 = 1\n    ok 4 - 1 + -1 = 0\n    1..4\nok 1 - addition # time=4.511ms\n\n# Subtest: multiplication\n    ok 1 - 10 * 0 = 0\n    ok 2 - 10 * 1 = 10\n    ok 3 - 10 * 10 = 100\n    ok 4 - 10 * 0.5 = 5\n    1..4\nok 2 - multiplication # time=1.968ms\n\n1..2\n# time=14.141ms\n```\n\nwhen flattened would represent the same core eight assertions:\n\n```\n$ cat test/fixtures/subtests.tap | tap-flattener\nTAP version 13\nok 1 - addition 1 + 2 = 3\nok 2 - addition 5 + 5 = 10\nok 3 - addition 1 + 0 = 1\nok 4 - addition 1 + -1 = 0\nok 5 - multiplication 10 * 0 = 0\nok 6 - multiplication 10 * 1 = 10\nok 7 - multiplication 10 * 10 = 100\nok 8 - multiplication 10 * 0.5 = 5\n# time=14.141ms\n1..8\n```\n\n## Usage\n\n``` js\nvar Flatener = require('tap-flattener');\nvar flat = new Flatener(function (results) {\n  console.dir(results);\n});\n\nprocess.stdin.pipe(flat);\n```\n\n## CLI\n\nThis package also has a `tap-flattener` command.\n\n```\nUsage:\n  tap-flatener\n\nParses TAP data from stdin, and outputs the flattened TAP data to stdout.\n```\n\n## API\n\nUnder the covers, `tap-flattener` is writing to and reading from a `tap-parser` stream. As such it conforms to the same [core API] and [named events]. _The two exceptions to this are:_\n\n- No `line` events are emitted. Listen for individual `assert`, `complete`, `plan`, and `version` events instead.\n- No `child` events are emitted. **The subtests represented by these `child` events are instead transformed into `assert` events.**\n\n## Run Tests\n\nTests are written with [tap] and can be run with `npm`:\n\n```\nnpm test\n```\n\n##### LICENSE: MIT\n##### AUTHOR: [Charlie Robbins](https://github.com/indexzero)\n\n[core API]: https://github.com/tapjs/tap-parser#methods\n[named events]: https://github.com/tapjs/tap-parser#events\n[subtests]: https://github.com/tapjs/tap-parser#subtests\n[TAP 13]: https://testanything.org/tap-version-13-specification.html\n[tap]: http://www.node-tap.org/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Findexzero%2Ftap-flattener","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Findexzero%2Ftap-flattener","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Findexzero%2Ftap-flattener/lists"}