{"id":13472310,"url":"https://github.com/lukeed/uvu","last_synced_at":"2025-05-13T00:05:20.499Z","repository":{"id":38379309,"uuid":"263157374","full_name":"lukeed/uvu","owner":"lukeed","description":"uvu is an extremely fast and lightweight test runner for Node.js and the browser","archived":false,"fork":false,"pushed_at":"2024-08-30T16:52:27.000Z","size":314,"stargazers_count":2994,"open_issues_count":83,"forks_count":98,"subscribers_count":19,"default_branch":"master","last_synced_at":"2025-05-13T00:05:14.234Z","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/lukeed.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","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,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"lukeed"}},"created_at":"2020-05-11T21:02:01.000Z","updated_at":"2025-05-10T14:09:24.000Z","dependencies_parsed_at":"2024-01-20T18:21:25.488Z","dependency_job_id":"26124c90-76e8-4d11-923b-665f24bc1ca8","html_url":"https://github.com/lukeed/uvu","commit_stats":{"total_commits":238,"total_committers":24,"mean_commits":9.916666666666666,"dds":"0.10924369747899154","last_synced_commit":"9419247b8f93b61ce9a3aeca562f08491101a765"},"previous_names":[],"tags_count":42,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lukeed%2Fuvu","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lukeed%2Fuvu/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lukeed%2Fuvu/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lukeed%2Fuvu/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lukeed","download_url":"https://codeload.github.com/lukeed/uvu/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253843213,"owners_count":21972873,"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-07-31T16:00:53.705Z","updated_at":"2025-05-13T00:05:20.467Z","avatar_url":"https://github.com/lukeed.png","language":"JavaScript","readme":"\u003cdiv align=\"center\"\u003e\n  \u003cimg src=\"shots/uvu.jpg\" alt=\"uvu\" height=\"120\" /\u003e\n\u003c/div\u003e\n\n\u003cdiv align=\"center\"\u003e\n  \u003ca href=\"https://npmjs.org/package/uvu\"\u003e\n    \u003cimg src=\"https://badgen.now.sh/npm/v/uvu\" alt=\"version\" /\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://github.com/lukeed/uvu/actions\"\u003e\n    \u003cimg src=\"https://github.com/lukeed/uvu/workflows/CI/badge.svg\" alt=\"CI\" /\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://licenses.dev/npm/uvu\"\u003e\n    \u003cimg src=\"https://licenses.dev/b/npm/uvu\" alt=\"licenses\" /\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://npmjs.org/package/uvu\"\u003e\n    \u003cimg src=\"https://badgen.now.sh/npm/dm/uvu\" alt=\"downloads\" /\u003e\n  \u003c/a\u003e\n\u003c/div\u003e\n\n\u003cdiv align=\"center\"\u003e\n  \u003cb\u003euvu\u003c/b\u003e is an extremely fast and lightweight test runner for Node.js and the browser\u003cbr\u003e\n  \u003cb\u003eU\u003c/b\u003eltimate \u003cb\u003eV\u003c/b\u003eelocity, \u003cb\u003eU\u003c/b\u003enleashed\u003cbr\u003e\u003cbr\u003e\n  \u003cimg width=\"380\" alt=\"example with suites\" src=\"shots/suites.gif\"/\u003e\n\u003c/div\u003e\n\n\n## Features\n\n* Super [lightweight](https://npm.anvaka.com/#/view/2d/uvu)\n* Extremely [performant](#benchmarks)\n* Individually executable test files\n* Supports `async`/`await` tests\n* Supports native ES Modules\n* Browser-Compatible\n* Familiar API\n\n\n## Install\n\n```\n$ npm install --save-dev uvu\n```\n\n\n## Usage\n\n\u003e Check out [`/examples`](/examples) for a list of working demos!\n\n```js\n// tests/demo.js\nimport { test } from 'uvu';\nimport * as assert from 'uvu/assert';\n\ntest('Math.sqrt()', () =\u003e {\n  assert.is(Math.sqrt(4), 2);\n  assert.is(Math.sqrt(144), 12);\n  assert.is(Math.sqrt(2), Math.SQRT2);\n});\n\ntest('JSON', () =\u003e {\n  const input = {\n    foo: 'hello',\n    bar: 'world'\n  };\n\n  const output = JSON.stringify(input);\n\n  assert.snapshot(output, `{\"foo\":\"hello\",\"bar\":\"world\"}`);\n  assert.equal(JSON.parse(output), input, 'matches original');\n});\n\ntest.run();\n```\n\nThen execute this test file:\n\n```sh\n# via `uvu` cli, for all `/tests/**` files\n$ uvu -r esm tests\n\n# via `node` directly, for file isolation\n$ node -r esm tests/demo.js\n```\n\n\u003e **Note:** The `-r esm` is for legacy Node.js versions. [Learn More](/docs/esm.md)\n\n\u003e [View the `uvu` CLI documentation](/docs/cli.md)\n\n\n## Assertions\n\nThe [`uvu/assert`](/docs/api.assert.md) module is _completely_ optional.\n\nIn fact, you may use any assertion library, including Node's native [`assert`](https://nodejs.org/api/assert.html) module! This works because `uvu` relies on thrown Errors to detect failures. Implicitly, this also means that any uncaught exceptions and/or unhandled `Promise` rejections will result in a failure, which is what you want!\n\n\n## API\n\n### Module: `uvu`\n\n\u003e [View `uvu` API documentation](/docs/api.uvu.md)\n\nThe main entry from which you will import the `test` or `suite` methods.\n\n### Module: `uvu/assert`\n\n\u003e [View `uvu/assert` API documentation](/docs/api.assert.md)\n\nA collection of assertion methods to use within your tests. Please note that:\n\n* these are browser compatible\n* these are _completely_ optional\n\n\n## Benchmarks\n\n\u003e via the [`/bench`](/bench) directory with Node v10.21.0\n\nBelow you'll find each test runner with two timing values:\n\n* the `took ___` value is the total process execution time – from startup to termination\n* the parenthesis value (`(___)`) is the self-reported execution time, if known\n\nEach test runner's `stdout` is printed to the console to verify all assertions pass.\u003cbr\u003eSaid output is excluded below for brevity.\n\n```\n~\u003e \"ava\"   took   594ms  (  ???  )\n~\u003e \"jest\"  took   962ms  (356  ms)\n~\u003e \"mocha\" took   209ms  (  4  ms)\n~\u003e \"tape\"  took   122ms  (  ???  )\n~\u003e \"uvu\"   took    72ms  (  1.3ms)\n```\n\n\n## License\n\nMIT © [Luke Edwards](https://lukeed.com)\n","funding_links":["https://github.com/sponsors/lukeed"],"categories":["JavaScript","Packages"],"sub_categories":["Testing"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flukeed%2Fuvu","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flukeed%2Fuvu","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flukeed%2Fuvu/lists"}