{"id":20731663,"url":"https://github.com/tapjs/libtap","last_synced_at":"2025-04-23T22:06:04.450Z","repository":{"id":36508063,"uuid":"227888942","full_name":"tapjs/libtap","owner":"tapjs","description":"A Test-Anything-Protocol library for JavaScript","archived":false,"fork":false,"pushed_at":"2023-10-10T17:29:50.000Z","size":9093,"stargazers_count":4,"open_issues_count":8,"forks_count":12,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-04-23T22:05:57.450Z","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":"isc","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tapjs.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null},"funding":{"github":["isaacs"]}},"created_at":"2019-12-13T17:18:11.000Z","updated_at":"2022-12-13T18:07:57.000Z","dependencies_parsed_at":"2023-10-10T21:15:13.637Z","dependency_job_id":null,"html_url":"https://github.com/tapjs/libtap","commit_stats":{"total_commits":1951,"total_committers":87,"mean_commits":22.42528735632184,"dds":"0.13070220399794974","last_synced_commit":"7d2934adb69b53f16e8284d1ea5d9ad4db484d55"},"previous_names":[],"tags_count":16,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tapjs%2Flibtap","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tapjs%2Flibtap/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tapjs%2Flibtap/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tapjs%2Flibtap/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tapjs","download_url":"https://codeload.github.com/tapjs/libtap/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250522298,"owners_count":21444511,"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-11-17T05:16:19.694Z","updated_at":"2025-04-23T22:06:03.901Z","avatar_url":"https://github.com/tapjs.png","language":"JavaScript","funding_links":["https://github.com/sponsors/isaacs"],"categories":[],"sub_categories":[],"readme":"# libtap\n\nA \u003cabbr title=\"Test Anything Protocol\"\u003eTAP\u003c/abbr\u003e test library for\nNode.js.\n\n## `libtap` vs `tap`\n\n`tap` extends this module and provides many other nice features.  Generally\nyou should be using `require('tap')` instead of `require('libtap')`.  In some\nedge cases it can be appropriate to use `libtap` directly.\n\n* Install size is important - `libtap` has significantly less dependencies.\n* Your tests are suspectable to transformations or other environmental changes.\n  `tap` does things that are useful by default, if this causes problems for your\n  code you may wish to go lower level.\n\n### Recursive rmdir\n\nSome parts of `libtap` require recursive rmdir functions.  In Node.js 12.10.0+\nthis is provided by the Node.js core `fs` module.  For older versions of Node.js you\nmust set compatible functions:\n\n```js\nconst rimraf = require('rimraf')\nconst settings = require('libtap/settings')\nsettings.rmdirRecursiveSync = dir =\u003e rimraf.sync(dir, {glob: false})\nsettings.rmdirRecursive = (dir, cb) =\u003e rimraf(dir, {glob: false}, cb)\n```\n\nThis is handled by `tap` so only direct users of `libtap` who need to support older\nversions of Node.js need to worry about this.\n\nIt is not considered semver-major for a libtap function to use recursive rmdir where\nit previously did not.  If you test on older versions of Node.js then you must ensure\na user-space implementation is available even if it is not currently needed.\n\n## Environmental changes still in place\n\n* signal-exit is run\n* async-domain-hook is run\n* process.stdout.emit is monkey-patched to swallow EPIPE errors\n* process.reallyExit and process.exit are monkey-patched\n* Handlers are added to process `beforeexit` and `exit` events\n\nThese all have an effect on the environment and may be undesirable in some edge cases.\nShould any/all of these be opt-out or even opt-in?  The goal is to be able to create\nfunctional tests using `require('libtap')`.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftapjs%2Flibtap","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftapjs%2Flibtap","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftapjs%2Flibtap/lists"}