🚀 JavaScript test runner

License: MIT

Language: JavaScript

Keywords: assert, async, async-functions, ava, babel, cli, cli-app, concurrency, es2015, javascript, node, nodejs, performance, tap, tdd, test-framework, test-runner, testing, unicorns, unit-testing

AVA logo

Build Status Coverage Status XO code style Join the community on Spectrum Mentioned in Awesome Node.js

Testing can be a drag. AVA helps you get it done. AVA is a test runner for Node.js with a concise API, detailed error output, embrace of new language features and process isolation that let you write tests more effectively. So you can ship more awesome code. 🚀

Follow the AVA Twitter account for updates.

Read our contributing guide if you're looking to contribute (issues / PRs / etc).

Translations: Español, Français, Italiano, 日本語, 한국어, Português, Русский, 简体中文

Why AVA?


To install and set up AVA, run:

npm init ava

Your package.json will then look like this (exact version notwithstanding):

	"name": "awesome-package",
	"scripts": {
		"test": "ava"
	"devDependencies": {
		"ava": "^1.0.0"

Or if you prefer using Yarn:

yarn add ava --dev

Alternatively you can install ava manually:

npm install --save-dev ava

Don't forget to configure the test script in your package.json as per above.

Create your test file

Create a file named test.js in the project root directory:

import test from 'ava';

test('foo', t => {

test('bar', async t => {
	const bar = Promise.resolve('bar');
	t.is(await bar, 'bar');

Running your tests

npm test

Or with npx:

npx ava

Run with the --watch flag to enable AVA's watch mode:

npx ava --watch

Supported Node.js versions

AVA supports the latest release of any major version that is supported by Node.js itself. Read more in our support statement.


Magic assert

AVA 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.

Clean stack traces

AVA automatically removes unrelated lines in stack traces, allowing you to find the source of an error much faster, as seen above.

Latest JavaScript support

AVA uses Babel 7 so you can use the latest JavaScript syntax in your tests. There is no extra setup required. You don't need to be using Babel in your own project for this to work either.

We aim to support all finished syntax proposals, as well as all syntax from ratified JavaScript versions (e.g. ES2017). See our @ava/stage-4 preset for the currently supported proposals.

Please note that we do not add or modify built-ins. For example, if you use Object.fromEntries() in your tests, they will crash in Node.js 10 which does not implement this method.

You can disable this syntax support, or otherwise customize AVA's Babel pipeline. See our Babel recipe for more details.

Parallel runs in CI

AVA 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 package for a list of supported CI environments.


Please see the files in the docs directory:

Common pitfalls

We have a growing list of common pitfalls you may experience while using AVA. If you encounter any issues you think are common, comment in this issue.



Why not mocha, tape, tap?

Mocha requires you to use implicit globals like describe and it with the default interface (which most people use). It's not very opinionated and executes tests serially without process isolation, making it slow.

Tape and tap are pretty good. AVA is highly inspired by their syntax. They too execute tests serially. Their default TAP output isn't very user-friendly though so you always end up using an external tap reporter.

In contrast AVA is highly opinionated and runs tests concurrently, with a separate process for each test file. Its default reporter is easy on the eyes and yet AVA still supports TAP output through a CLI flag.

How is the name written and pronounced?

AVA, not Ava or ava. Pronounced /ˈeɪvə/: Ay (face, made) V (vie, have) A (comma, ago)

What is the header background?

It's the Andromeda galaxy.

What is the difference between concurrency and parallelism?

Concurrency is not parallelism. It enables parallelism.





Mark Wubben Sindre Sorhus Vadim Demedes
Mark Wubben Sindre Sorhus Vadim Demedes

Project Statistics

Sourcerank 21
Repository Size 8.89 MB
Stars 17,057
Forks 1,147
Watchers 247
Open issues 159
Dependencies 1,649
Contributors 234
Tags 65
Last updated
Last pushed

Top Contributors See all

Mark Wubben Sindre Sorhus James Talmage Vadim Demedes Juan Soto Forresst Kevin Mårtensson Sam Verschueren Vsevolod Strukchinsky Luke Childs Ari Porad Nuno Campos Kent C. Dodds Arjay Sitoy Jeroen Engels Oky Antoro Jamie Kyle Nikita Volodin Guang Chen Ivo Gabe de Wolff

Packages Referencing this Repo

Futuristic test runner 🚀
Latest release 0.19.3 - Updated - 17.1K stars
Futuristic test runner 🚀
Latest release 0.15.3 - Updated - 17.1K stars
Testing can be a drag. AVA helps you get it done.
Latest release 2.4.0 - Updated - 17.1K stars
Futuristic test runner 🚀
Latest release 0.14.1 - Updated - 17.1K stars
Futuristic test runner 🚀
Latest release 0.16.4 - Updated - 17.1K stars
Futuristic test runner 🚀
Latest release 0.16.0 - Published - 17.1K stars

Recent Tags See all

v2.4.0 September 16, 2019
v2.3.0 August 18, 2019
v2.2.0 July 08, 2019
v2.1.0 June 10, 2019
v2.0.0 June 01, 2019
v2.0.0-rc.1 May 28, 2019
v2.0.0-beta.2 May 19, 2019
v2.0.0-beta.1 April 29, 2019
v1.4.1 March 27, 2019
v1.4.0 March 24, 2019
v1.3.1 March 05, 2019
v1.3.0 March 05, 2019
v1.2.1 February 05, 2019
v1.2.0 January 27, 2019
v1.1.0 January 13, 2019

Interesting Forks See all

Futuristic test runner rocket
JavaScript - Updated - 2 stars
Futuristic test runner rocket
JavaScript - MIT - Last pushed - 1 stars - 1 forks
rocket Futuristic JavaScript test runner
JavaScript - Last pushed - 1 stars
Futuristic test runner rocket
JavaScript - Updated - 1 stars
rocket Futuristic JavaScript test runner
JavaScript - Updated - 1 stars

Something wrong with this page? Make a suggestion

Last synced: 2019-09-16 07:13:18 UTC

Login to resync this repository