AVA

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

install

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

# via npm
npm install --save-dev ava
# via Yarn
yarn add ava --dev

Alternatives & related tools

add a badge to your README

Maintain AVA? Show that it's featured on trmn. The badge links back to this page.

Featured on trmn
Markdown
[![Featured on trmn](https://www.trmn.sh/badge/ava.svg)](https://www.trmn.sh/tools/ava?utm_source=badge)
HTML
<a href="https://www.trmn.sh/tools/ava?utm_source=badge"><img src="https://www.trmn.sh/badge/ava.svg" alt="Featured on trmn" height="20"></a>