{"id":13393472,"url":"https://github.com/avajs/ava","last_synced_at":"2025-05-12T16:09:43.913Z","repository":{"id":23456863,"uuid":"26820798","full_name":"avajs/ava","owner":"avajs","description":"Node.js test runner that lets you develop with confidence 🚀","archived":false,"fork":false,"pushed_at":"2025-04-14T19:55:07.000Z","size":13859,"stargazers_count":20770,"open_issues_count":72,"forks_count":1405,"subscribers_count":222,"default_branch":"main","last_synced_at":"2025-04-15T08:01:56.444Z","etag":null,"topics":["assert","async","async-functions","ava","cli","cli-app","concurrency","javascript","node","nodejs","performance","tap","tdd","test-framework","test-runner","testing","unicorns","unit-testing"],"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/avajs.png","metadata":{"files":{"readme":"readme.md","changelog":null,"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":"docs/support-statement.md","governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2014-11-18T17:20:26.000Z","updated_at":"2025-04-14T19:55:11.000Z","dependencies_parsed_at":"2024-01-21T21:08:53.285Z","dependency_job_id":"4536ae2a-f661-478c-af0b-7a1a275264fa","html_url":"https://github.com/avajs/ava","commit_stats":{"total_commits":1859,"total_committers":332,"mean_commits":5.599397590361446,"dds":0.591715976331361,"last_synced_commit":"024de32a15aba9fac4002aa8d3c2c076955f44f4"},"previous_names":["sindresorhus/ava"],"tags_count":115,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/avajs%2Fava","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/avajs%2Fava/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/avajs%2Fava/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/avajs%2Fava/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/avajs","download_url":"https://codeload.github.com/avajs/ava/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249031775,"owners_count":21201357,"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":["assert","async","async-functions","ava","cli","cli-app","concurrency","javascript","node","nodejs","performance","tap","tdd","test-framework","test-runner","testing","unicorns","unit-testing"],"created_at":"2024-07-30T17:00:53.721Z","updated_at":"2025-04-15T08:02:27.111Z","avatar_url":"https://github.com/avajs.png","language":"JavaScript","readme":"*[Please support our friend Vadim Demedes and the people in Ukraine.](https://stand-with-ukraine.pp.ua/)*\n\n---\n\n# \u003cimg src=\"media/header.png\" title=\"AVA\" alt=\"AVA logo\" width=\"530\"\u003e\n\nAVA is a test runner for Node.js with a concise API, detailed error output, embrace of new language features and thread isolation that lets you develop with confidence 🚀\n\nWatch this repository and follow the [Discussions](https://github.com/avajs/ava/discussions) for updates.\n\nRead our [contributing guide](.github/CONTRIBUTING.md) if you're looking to contribute (issues / PRs / etc).\n\n![](media/verbose-reporter.png)\n\n\nTranslations: [Español](https://github.com/avajs/ava-docs/blob/main/es_ES/readme.md), [Français](https://github.com/avajs/ava-docs/blob/main/fr_FR/readme.md), [Italiano](https://github.com/avajs/ava-docs/blob/main/it_IT/readme.md), [日本語](https://github.com/avajs/ava-docs/blob/main/ja_JP/readme.md), [한국어](https://github.com/avajs/ava-docs/blob/main/ko_KR/readme.md), [Português](https://github.com/avajs/ava-docs/blob/main/pt_BR/readme.md), [Русский](https://github.com/avajs/ava-docs/blob/main/ru_RU/readme.md), [简体中文](https://github.com/avajs/ava-docs/blob/main/zh_CN/readme.md)\n\n\n## Why AVA?\n\n- Minimal and fast\n- Simple test syntax\n- Runs tests concurrently\n- Enforces writing atomic tests\n- No implicit globals\n- Includes TypeScript definitions\n- [Magic assert](#magic-assert)\n- [Isolated environment for each test file](./docs/01-writing-tests.md#test-isolation)\n- [Promise support](./docs/01-writing-tests.md#promise-support)\n- [Async function support](./docs/01-writing-tests.md#async-function-support)\n- [Observable support](./docs/01-writing-tests.md#observable-support)\n- [Enhanced assertion messages](./docs/03-assertions.md#enhanced-assertion-messages)\n- [Automatic parallel test runs in CI](#parallel-runs-in-ci)\n- [TAP reporter](./docs/05-command-line.md#tap-reporter)\n\n\n## Usage\n\nTo install and set up AVA, run:\n\n```console\nnpm init ava\n```\n\nYour `package.json` will then look like this (exact version notwithstanding):\n\n```json\n{\n\t\"name\": \"awesome-package\",\n\t\"type\": \"module\",\n\t\"scripts\": {\n\t\t\"test\": \"ava\"\n\t},\n\t\"devDependencies\": {\n\t\t\"ava\": \"^5.0.0\"\n\t}\n}\n```\n\nOr if you prefer using Yarn:\n\n```console\nyarn add ava --dev\n```\n\nAlternatively you can install `ava` manually:\n\n```console\nnpm install --save-dev ava\n```\n\n*Make sure to install AVA locally. AVA cannot be run globally.*\n\nDon't forget to configure the `test` script in your `package.json` as per above.\n\n### Create your test file\n\nCreate a file named `test.js` in the project root directory.\n\n_Note that AVA's documentation assumes you're using ES modules._\n\n```js\nimport test from 'ava';\n\ntest('foo', t =\u003e {\n\tt.pass();\n});\n\ntest('bar', async t =\u003e {\n\tconst bar = Promise.resolve('bar');\n\tt.is(await bar, 'bar');\n});\n```\n\n### Running your tests\n\n```console\nnpm test\n```\n\nOr with `npx`:\n\n```console\nnpx ava\n```\n\nRun with the `--watch` flag to enable AVA's [watch mode](docs/recipes/watch-mode.md):\n\n```console\nnpx ava --watch\n```\n\n## Supported Node.js versions\n\nAVA supports the latest release of any major version that [is supported by Node.js itself](https://github.com/nodejs/Release#release-schedule). Read more in our [support statement](docs/support-statement.md).\n\n## Highlights\n\n### Magic assert\n\nAVA adds code excerpts and clean diffs for actual and expected values. If values in the assertion are objects or arrays, only a diff is displayed, to remove the noise and focus on the problem. The diff is syntax-highlighted too! If you are comparing strings, both single and multi line, AVA displays a different kind of output, highlighting the added or missing characters.\n\n![](media/magic-assert-combined.png)\n\n### Clean stack traces\n\nAVA automatically removes unrelated lines in stack traces, allowing you to find the source of an error much faster, as seen above.\n\n### Parallel runs in CI\n\nAVA automatically detects whether your CI environment supports parallel builds. Each build will run a subset of all test files, while still making sure all tests get executed. See the [`ci-parallel-vars`](https://www.npmjs.com/package/ci-parallel-vars) package for a list of supported CI environments.\n\n## Documentation\n\nPlease see the [files in the `docs` directory](./docs):\n\n* [Writing tests](./docs/01-writing-tests.md)\n* [Execution context](./docs/02-execution-context.md)\n* [Assertions](./docs/03-assertions.md)\n* [Snapshot testing](./docs/04-snapshot-testing.md)\n* [Command line (CLI)](./docs/05-command-line.md)\n* [Configuration](./docs/06-configuration.md)\n* [Test timeouts](./docs/07-test-timeouts.md)\n\n### Common pitfalls\n\nWe have a growing list of [common pitfalls](docs/08-common-pitfalls.md) you may experience while using AVA. If you encounter any issues you think are common, comment in [this issue](https://github.com/avajs/ava/issues/404).\n\n### Recipes\n\n- [Test setup](docs/recipes/test-setup.md)\n- [TypeScript](docs/recipes/typescript.md)\n- [Shared workers](docs/recipes/shared-workers.md)\n- [Watch mode](docs/recipes/watch-mode.md)\n- [When to use `t.plan()`](docs/recipes/when-to-use-plan.md)\n- [Passing arguments to your test files](docs/recipes/passing-arguments-to-your-test-files.md)\n- [Splitting tests in CI](docs/recipes/splitting-tests-ci.md)\n- [Code coverage](docs/recipes/code-coverage.md)\n- [Endpoint testing](docs/recipes/endpoint-testing.md)\n- [Browser testing](docs/recipes/browser-testing.md)\n- [Testing Vue.js components](docs/recipes/vue.md)\n- [Debugging tests with Chrome DevTools](docs/recipes/debugging-with-chrome-devtools.md)\n- [Debugging tests with VSCode](docs/recipes/debugging-with-vscode.md)\n- [Debugging tests with WebStorm](docs/recipes/debugging-with-webstorm.md)\n- [Isolated MongoDB integration tests](docs/recipes/isolated-mongodb-integration-tests.md)\n- [Testing web apps using Puppeteer](docs/recipes/puppeteer.md)\n- [Testing web apps using Selenium WebDriverJS](docs/recipes/testing-with-selenium-webdriverjs.md)\n\n## FAQ\n\n### How is the name written and pronounced?\n\nAVA, not Ava or ava. Pronounced [`/ˈeɪvə/`](media/pronunciation.m4a?raw=true): Ay (f**a**ce, m**a**de) V (**v**ie, ha**v**e) A (comm**a**, **a**go)\n\n### What is the header background?\n\nIt's the [Andromeda galaxy](https://simple.wikipedia.org/wiki/Andromeda_galaxy).\n\n### What is the difference between concurrency and parallelism?\n\n[Concurrency is not parallelism. It enables parallelism.](https://stackoverflow.com/q/1050222)\n\n## Support\n\n- [GitHub Discussions](https://github.com/avajs/ava/discussions)\n\n## Related\n\n- [eslint-plugin-ava](https://github.com/avajs/eslint-plugin-ava) — Lint rules for AVA tests\n- [@ava/typescript](https://github.com/avajs/typescript) — Test TypeScript projects\n- [@ava/cooperate](https://github.com/avajs/cooperate) — Low-level primitives to enable cooperation between test files\n- [@ava/get-port](https://github.com/avajs/get-port) — Reserve a port while testing\n\n## Links\n\n- [AVA stickers, t-shirts, etc](https://www.redbubble.com/people/sindresorhus/works/30330590-ava-logo)\n- [Awesome list](https://github.com/avajs/awesome-ava)\n- [Do you like AVA? Donate here!](https://opencollective.com/ava)\n- [More…](https://github.com/avajs/awesome-ava)\n\n## Team\n\n[![Mark Wubben](https://github.com/novemberborn.png?size=100)](https://github.com/novemberborn) | [![Sindre Sorhus](https://github.com/sindresorhus.png?size=100)](https://github.com/sindresorhus)\n---|---\n[Mark Wubben](https://novemberborn.net) | [Sindre Sorhus](https://sindresorhus.com)\n\n###### Former\n\n- [Kevin Mårtensson](https://github.com/kevva)\n- [James Talmage](https://github.com/jamestalmage)\n- [Juan Soto](https://github.com/sotojuan)\n- [Jeroen Engels](https://github.com/jfmengels)\n- [Vadim Demedes](https://github.com/vadimdemedes)\n\n\n\u003cdiv align=\"center\"\u003e\n\t\u003cbr\u003e\n\t\u003cbr\u003e\n\t\u003cbr\u003e\n\t\u003ca href=\"https://avajs.dev\"\u003e\n\t\t\u003cimg src=\"media/logo.svg\" width=\"200\" alt=\"AVA\"\u003e\n\t\u003c/a\u003e\n\t\u003cbr\u003e\n\t\u003cbr\u003e\n\u003c/div\u003e\n","funding_links":["https://opencollective.com/ava"],"categories":["Test runners","JavaScript","Packages","Uncategorized","Testing Frameworks","测试框架","Repository","Node.js Tools","\u003ca name=\"cli\"\u003e\u003c/a\u003e Command Line Interfaces","Testing Frameworks [🔝](#readme)","包","目录","Test","后端开发框架及项目","📦 Modules/Packages","cli","Ionic Tools, Libraries, and Frameworks","\u003e 10K ⭐️","Testing","Tools","Unit Testing","Test Library Documentation"],"sub_categories":["Testing","Uncategorized","Frameworks","框架","In-memory data grids","测试","测试相关","Interfaces","IDE","管理面板","Objective-C Tools, Libraries, and Frameworks","Mesh networks","JavaScript Libraries for Machine Learning","Other Frameworks"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Favajs%2Fava","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Favajs%2Fava","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Favajs%2Fava/lists"}