{"id":17736623,"url":"https://github.com/parro-it/tape-async","last_synced_at":"2025-04-28T15:32:28.092Z","repository":{"id":42702957,"uuid":"42958431","full_name":"parro-it/tape-async","owner":"parro-it","description":"A tiny wrapper around tape to simplify async testing.","archived":false,"fork":false,"pushed_at":"2022-11-10T00:40:24.000Z","size":103,"stargazers_count":32,"open_issues_count":3,"forks_count":3,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-10-13T02:19:13.003Z","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/parro-it.png","metadata":{"files":{"readme":"readme.md","changelog":null,"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-09-22T20:16:35.000Z","updated_at":"2023-08-18T09:30:11.000Z","dependencies_parsed_at":"2023-01-21T20:17:55.108Z","dependency_job_id":null,"html_url":"https://github.com/parro-it/tape-async","commit_stats":null,"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/parro-it%2Ftape-async","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/parro-it%2Ftape-async/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/parro-it%2Ftape-async/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/parro-it%2Ftape-async/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/parro-it","download_url":"https://codeload.github.com/parro-it/tape-async/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251338630,"owners_count":21573587,"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-26T00:23:45.829Z","updated_at":"2025-04-28T15:32:27.921Z","avatar_url":"https://github.com/parro-it.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# tape-async\n\n[![Greenkeeper badge](https://badges.greenkeeper.io/parro-it/tape-async.svg)](https://greenkeeper.io/)\n\n\u003e A lite wrapper around [tape](https://github.com/substack/tape) to simplify async testing.\n\n[![Travis Build Status](https://img.shields.io/travis/parro-it/tape-async.svg)](http://travis-ci.org/parro-it/tape-async)\n[![NPM module](https://img.shields.io/npm/v/tape-async.svg)](https://npmjs.org/package/tape-async)\n[![NPM downloads](https://img.shields.io/npm/dt/tape-async.svg)](https://npmjs.org/package/tape-async)\n\n# Installation\n\n```bash\nnpm install -D tape-async\n```\n\n# Usage\n\n## Use with `async-await`\n\n```js\nconst test = require(\"tape-async\");\nconst sleep = require(\"sleep-promise\");\n\ntest(\"this test will successfully pass\", async (t) =\u003e {\n  await sleep(100);\n  const a = await Promise.resolve(42);\n  t.equal(a, 42);\n});\n```\n\n`tape-async` supports async-await syntax.\nYou are in charge of transpiling your test code.\n\n## Use with `generators`\n\n```js\nconst test = require(\"tape-async\");\nconst sleep = require(\"sleep-promise\");\n\ntest(\"this test will successfully pass\", function* (t) {\n  const result = yield Promise.resolve(42);\n  t.equal(result, 42);\n});\n```\n\n`tape-async` supports generators test to handle async code.\nThey run using [co](https://github.com/tj/co).\n\n## It catches unhandled errors\n\n```js\nconst test = require(\"tape-async\");\ntest(\"this test will fail\", () =\u003e {\n  setTimeout(() =\u003e {\n    throw new Error(\"unhandled\");\n  }, 100);\n});\n```\n\nUnhandled errors in your tests are automatically covered.\nTest suite fails with a generic error message and a stack trace.\n\n## It catches unhandled `Promise` rejections\n\n```js\nconst test = require(\"tape-async\");\ntest(\"this test will fail\", () =\u003e {\n  Promise.reject(new Error(\"unhandled\"));\n});\n```\n\nUncatched Promise rejections in your tests are automatically covered.\nTest suite fails with a generic error message and a stack trace.\n\n## It supports every [tape](https://github.com/substack/tape) features.\n\n```js\nconst test = require(\"tape-async\");\ntest.skip(\"this test will be skipped\", () =\u003e {});\n\ntest.only(\"this test will be the only one\", (t) =\u003e {\n  t.equal(42, 42);\n  t.end();\n});\n```\n\nSince this is only a tiny wrapper around `tape`, you can\nuse every feature you are used to.\n\n# Related projects\n\n- [tape](https://github.com/substack/tape) - tap-producing test harness for node and browsers.\n- [tape-await](https://ghub.io/tape-await) - another async tape implementation.\n\n# License\n\nThe MIT License (MIT)\n\nCopyright (c) 2016 Andrea Parodi\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fparro-it%2Ftape-async","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fparro-it%2Ftape-async","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fparro-it%2Ftape-async/lists"}