
AVA
A test runner for Node.js with a concise API and detailed error output.
- Stars
- 20.8k
- Forks
- 1.5k
- Licence
- MIT
- Language
- JavaScript
- Last update
- 5 days ago
- Type
- Dev tool
What it is
AVA is a testing tool for JavaScript code that runs on Node.js. You write small test functions, run one command, and it reports which checks passed or failed, with clear diffs showing the difference between expected and actual values. Its README highlights running tests concurrently and giving each test file its own isolated environment.
- Write unit tests for a Node.js module using the test() function and t.is() or t.pass() assertions
- Run tests in watch mode with npx ava --watch while you edit code
- Run test files in parallel across CI builds using automatic CI detection
- Test async code, including Promises and async functions, without extra setup
Great for
- Node.js developers who want a small, straightforward test runner
- Projects that use ES modules, which the README says the documentation assumes
- Teams running tests in CI who want automatic splitting of test files across parallel builds
- Developers who want built-in TypeScript definitions and async or Promise test support
Not ideal for
- People who need a browser-only testing tool; the README lists browser testing only as a recipe, not a core feature
- Projects that must run AVA globally, since the README says AVA cannot be run globally and must be installed locally
- Anyone on an unsupported Node.js version, since AVA only supports the latest release of each Node.js major version that Node.js itself supports
How to get it
- 1
Install with a package manager
You'll need: Node.js (the README does not state a specific version beyond supporting the latest release of each supported major version) · npm or Yarn
Set up AVA in a project (recommended)
npm init avaInstall manually with npm
npm install --save-dev avaInstall with Yarn
yarn add ava --dev - 2
Run it
- Run npm init ava to install and configure AVA in your project
- Create a test.js file in the project root with a test() call
- Run npm test or npx ava to execute the tests
- Run npx ava --watch to re-run tests automatically while you edit
- 3
Get the most out of it
- Use watch mode (npx ava --watch) during development to re-run tests on change
- Configure CI to take advantage of automatic parallel runs across builds
- Read the docs for writing tests, assertions, and snapshot testing in the docs directory
- Follow the TypeScript recipe if your project uses TypeScript
- Use the Debugging recipes for Chrome DevTools, VSCode, or WebStorm when a test fails
Downloads
Strengths
- The README describes a concise API with detailed, syntax-highlighted diffs on failure
- Tests run concurrently and each test file gets an isolated environment
- Includes TypeScript definitions and a TAP reporter
Trade-offs
- Must be installed locally in each project; it cannot be run globally
- Documentation assumes ES modules, which may need adjustment for older CommonJS projects
- The README is truncated here, so some details of configuration and advanced features are not covered in this entry
How it compares
| Project | Stars | Type | Level | Updated | Best for |
|---|---|---|---|---|---|
| ava (this) | 20.8k | Dev tool | beginner | 5 days ago | Node.js developers who want a small, straightforward test runner |
| jest | 45.5k | Library | beginner | 4 days ago | JavaScript or TypeScript developers who want a testing setup that works with little configuration |
| mocha | 22.9k | Library | intermediate | 5 days ago | JavaScript and Node.js developers who want automated tests for their code |
| vitest | 17.3k | Library | intermediate | 4 days ago | JavaScript or TypeScript developers already using Vite |
| solid | 36.2k | Library | intermediate | 4 days ago | Developers who want fine-grained control over what re-renders in a web UI |
| async | 28.1k | Library | intermediate | 4 days ago | JavaScript developers who need to run many asynchronous operations over a collection of items |
Stats synced from GitHub. The assessment above was drafted with AI from the project's README on 2026-10-29 and may miss recent changes — check the README before relying on a command. MIT licence: free to use, modify and distribute, including commercially, as long as you keep the copyright notice.