{"id":19921854,"url":"https://github.com/dhershman1/tap-junit","last_synced_at":"2025-04-05T21:10:54.922Z","repository":{"id":20448600,"uuid":"89938519","full_name":"dhershman1/tap-junit","owner":"dhershman1","description":"A silly simple, silly small XML output for tap/tape tests to convert them to junit","archived":false,"fork":false,"pushed_at":"2024-10-08T01:25:55.000Z","size":277,"stargazers_count":17,"open_issues_count":1,"forks_count":5,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-29T20:08:56.849Z","etag":null,"topics":["junit","tap","tap-junit","testing","xml"],"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/dhershman1.png","metadata":{"files":{"readme":"README.md","changelog":"changelog.md","contributing":".github/CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":".github/CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-05-01T15:58:26.000Z","updated_at":"2024-12-27T12:18:17.000Z","dependencies_parsed_at":"2024-06-18T15:27:57.821Z","dependency_job_id":"1dbe5e39-ffbd-4483-9ac2-373ac245f1e0","html_url":"https://github.com/dhershman1/tap-junit","commit_stats":{"total_commits":183,"total_committers":8,"mean_commits":22.875,"dds":"0.21311475409836067","last_synced_commit":"fa306ea90f2b74ceecf819ca47aa2acc086c5e6b"},"previous_names":[],"tags_count":17,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dhershman1%2Ftap-junit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dhershman1%2Ftap-junit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dhershman1%2Ftap-junit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dhershman1%2Ftap-junit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dhershman1","download_url":"https://codeload.github.com/dhershman1/tap-junit/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246758362,"owners_count":20828919,"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":["junit","tap","tap-junit","testing","xml"],"created_at":"2024-11-12T22:08:37.640Z","updated_at":"2025-04-05T21:10:54.905Z","avatar_url":"https://github.com/dhershman1.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"![GitHub Actions Workflow Status](https://img.shields.io/github/actions/workflow/status/dhershman1/tap-junit/tap-junit.yml?style=flat-square)\n[![npm](https://img.shields.io/npm/v/tap-junit.svg?style=flat-square)](https://www.npmjs.com/package/tap-junit)\n[![Downloads](https://img.shields.io/npm/dm/tap-junit.svg?style=flat-square)](https://www.npmjs.com/package/tap-junit)\n\n# tap-junit\n\nSilly small, silly easy junit output formatter for tap.\n\nWorks with [tape](https://github.com/substack/tape) and other tap based tests just pipe it into tap-junit\n\n## Parameters\n\n- `-c, --classname` - The name you want to apply to the `testsuite` element (if not set no name is given to the output testsuite)\n- `-o, --output` - designate where you want the .xml results to output\n  - If you do not specify an output then results will be displayed within the terminal\n- `-n, --name` - value provided will be the name of the `output.xml` file, otherwise defaults to `tap.xml`\n- `-s, --suite` - sets the main test suite name defaults to Tap-Junit if not passed\n- `-v, --version` - displays the current tap-junit version\n- `-i, --input` - Specify a specific tap txt input file to transform\n- `-p, --pretty` - Specify if you want the output xml to be prettified or not this is `false` by default\n\n## Installation\n\n```\nnpm i -D tap-junit\n```\n\n## Usage\n\n```\ntape test/*.js | tap-junit --output output/test\n\nnode test.js | ./node_modules/tap-junit/bin/tap-junit --output output/test\n\ntap-junit -o output/tests -n nontape \u003c src/test/non-tape.tap\n\ntape tests/thing.js | tap-junit \u003e output/thing.xml\n\ntap-junit -i tap.txt -s suite-name\n```\n\nYou can now use custom extensions (in version 3.1.0+) simply add the extension to the end of your file name. If none is provided `tap-junit` will still default to `.xml`\n\n`tape test/*.js | tap-junit -o output/tests -n tape.xuni`\n\nThe above will create a file called `tape.xuni` in the `output/tests` directory with the results inside.\n\n## Output\n\nTap-Junit currently follows [this spec](https://github.com/junit-team/junit5/blob/main/platform-tests/src/test/resources/jenkins-junit.xsd) on junit syntax/layout\n\n```xml\n\u003ctestsuites tests=\"4\" name=\"Tap-Junit\" failures=\"2\"\u003e\n  \u003ctestsuite tests=\"4\" failures=\"2\" skipped=\"1\"\u003e\n    \u003ctestcase id=\"1\" name=\"test is equal\"/\u003e\n    \u003ctestcase id=\"2\" name=\"test skip extra # SKIP\"\u003e\n      \u003cskipped/\u003e\n    \u003c/testcase\u003e\n    \u003ctestcase id=\"3\" name=\"should not be equal\"/\u003e\n    \u003ctestcase id=\"4\" name=\"should be equal\"/\u003e\n  \u003c/testsuite\u003e\n\u003c/testsuites\u003e\n```\n\n## Comments\n\nSo Tap Junit takes a [tape]() style assumption when it comes to comments. That being, when a comment appears before a test (because that's how tape labels its tap output) it will be registered as a comment for that test, but the issue here is that you may lose placed comments in your tap files.\n\nAt the moment, I'm still trying to figure out a decent way to handle comments and record them. Keep this in mind that only a single comment before each test will currently be recorded for a system-out tag.\n\nIf you have ideas on how to better handle this, don't hesitate to reach out!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdhershman1%2Ftap-junit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdhershman1%2Ftap-junit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdhershman1%2Ftap-junit/lists"}