# AVA

> Node.js test runner that runs test files concurrently in isolated processes, with diff-based assertion output, TypeScript definitions, and watch mode.

Stars: 20.8k · Language: JavaScript · License: MIT · Categories: Dev Tools

- Repository: https://github.com/avajs/ava
- Page: https://www.trmn.sh/tools/ava

## Install

- npm: `npm install --save-dev ava`
- Yarn: `yarn add ava --dev`

## Overview

AVA is a test runner for Node.js. Tests are written with a small API (`import test from 'ava'`, then `test('name', t => { t.pass(); })`) and executed with the `ava` command, typically wired to the `test` script in `package.json`. It supports promises, async functions, and observables, and it ships with TypeScript definitions. It has no implicit globals and pushes you toward atomic tests.

Tests run concurrently, and each test file gets its own isolated environment. When an assertion fails, AVA prints a code excerpt and a syntax-highlighted diff of actual versus expected values. For objects and arrays only the diff is shown. Strings, single-line or multi-line, get character-level highlighting of added and missing text. Stack traces are trimmed of unrelated lines. A TAP reporter is available, and `ava --watch` enables watch mode.

In CI, AVA detects whether the environment supports parallel builds, using the `ci-parallel-vars` package. Each build then runs a subset of the test files while all tests still get executed. The documentation covers snapshot testing, configuration, test timeouts, shared workers, code coverage, and debugging with Chrome DevTools, VSCode, and WebStorm. Related packages include `eslint-plugin-ava` for lint rules, `@ava/typescript` for TypeScript projects, and `@ava/get-port` for reserving ports in tests. AVA must be installed locally and cannot be run globally. It supports the latest release of each major Node.js version that Node.js itself supports. Its users are Node.js and JavaScript/TypeScript developers.

### Installation

```bash
# via npm
npm install --save-dev ava
```

```bash
# via Yarn
yarn add ava --dev
```

## Alternatives

- [SVGO](https://www.trmn.sh/tools/svgo.md): Node.js library and CLI that optimizes SVG files by removing metadata, comments, hidden elements and redundant values, using a configurable plugin system. (JavaScript, 22.8k stars)
- [semantic-release](https://www.trmn.sh/tools/semantic-release.md): Automates releases from CI: derives the next semver version from commit messages, generates release notes, tags Git, and publishes packages via plugins. (JavaScript, 24.2k stars)
- [terminalizer](https://www.trmn.sh/tools/terminalizer.md): Terminal session recorder that generates animated GIF images from command-line sessions (JavaScript, 16.2k stars)
- [release-it](https://www.trmn.sh/tools/release-it.md): Generic CLI for automating releases: version bumps, git commit/tag/push, changelogs, GitHub/GitLab releases, and npm publishing, with hooks and plugins. (JavaScript, 9.1k stars)
- [np](https://www.trmn.sh/tools/np.md): Interactive release tool for npm packages that checks the working tree, runs tests, bumps versions, creates tags, publishes, and pushes to Git. (JavaScript, 7.7k stars)

---

Canonical: https://www.trmn.sh/tools/ava
