ava
Node.js test runner that lets you develop with confidence.
Last updated 8 months ago by novemberborn .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ npm install ava 
SYNC missed versions from official npm registry.

Please support our friend Vadim Demedes and the people in Ukraine.


AVA logo

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

Watch this repository and follow the Discussions 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?

Usage

To install and set up AVA, run:

npm init ava

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

{
	"name": "awesome-package",
	"type": "module",
	"scripts": {
		"test": "ava"
	},
	"devDependencies": {
		"ava": "^5.0.0"
	}
}

Or if you prefer using Yarn:

yarn add ava --dev

Alternatively you can install ava manually:

npm install --save-dev ava

Make sure to install AVA locally. AVA cannot be run globally.

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.

Note that AVA's documentation assumes you're using ES modules.

import test from 'ava';

test('foo', t => {
	t.pass();
});

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.

Highlights

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.

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.

Documentation

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.

Recipes

FAQ

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.

Support

Related

Links

Team

Mark Wubben Sindre Sorhus
Mark Wubben Sindre Sorhus
Former



AVA

Current Tags

  • 6.1.3                                ...           latest (8 months ago)

114 Versions

  • 6.1.3                                ...           8 months ago
  • 6.1.2                                ...           10 months ago
  • 6.1.1                                ...           a year ago
  • 6.1.0                                ...           a year ago
  • 6.0.1                                ...           a year ago
  • 6.0.0                                ...           a year ago
  • 5.3.1                                ...           2 years ago
  • 5.3.0                                ...           2 years ago
  • 5.2.0                                ...           2 years ago
  • 5.1.1                                ...           2 years ago
  • 5.1.0                                ...           2 years ago
  • 5.0.1                                ...           2 years ago
  • 5.0.0                                ...           2 years ago
  • 4.3.3                                ...           2 years ago
  • 4.3.2                                ...           2 years ago
  • 4.3.1                                ...           2 years ago
  • 4.3.0                                ...           3 years ago
  • 4.2.0                                ...           3 years ago
  • 4.1.0                                ...           3 years ago
  • 4.0.1                                ...           3 years ago
  • 4.0.0                                ...           3 years ago
  • 4.0.0-rc.1                                ...           3 years ago
  • 4.0.0-alpha.2                                ...           4 years ago
  • 4.0.0-alpha.1                                ...           4 years ago
  • 3.15.0                                ...           4 years ago
  • 3.14.0                                ...           4 years ago
  • 3.13.0                                ...           4 years ago
  • 3.12.1                                ...           4 years ago
  • 3.12.0                                ...           4 years ago
  • 3.11.1                                ...           4 years ago
  • 3.11.0                                ...           4 years ago
  • 3.10.1                                ...           4 years ago
  • 3.10.0                                ...           4 years ago
  • 3.9.0                                ...           5 years ago
  • 3.8.2                                ...           5 years ago
  • 3.8.1                                ...           5 years ago
  • 3.8.0                                ...           5 years ago
  • 3.7.1                                ...           5 years ago
  • 3.7.0                                ...           5 years ago
  • 3.6.0                                ...           5 years ago
  • 3.5.2                                ...           5 years ago
  • 3.5.1                                ...           5 years ago
  • 3.5.0                                ...           5 years ago
  • 3.4.0                                ...           5 years ago
  • 3.3.0                                ...           5 years ago
  • 3.2.0                                ...           5 years ago
  • 3.1.0                                ...           5 years ago
  • 3.0.0                                ...           5 years ago
  • 3.0.0-beta.2                                ...           5 years ago
  • 3.0.0-beta.1                                ...           5 years ago
  • 2.4.0                                ...           5 years ago
  • 2.3.0                                ...           5 years ago
  • 2.2.0                                ...           5 years ago
  • 2.1.0                                ...           6 years ago
  • 2.0.0                                ...           6 years ago
  • 2.0.0-rc.1                                ...           6 years ago
  • 2.0.0-beta.2                                ...           6 years ago
  • 2.0.0-beta.1                                ...           6 years ago
  • 1.4.1                                ...           6 years ago
  • 1.4.0                                ...           6 years ago
  • 1.3.1                                ...           6 years ago
  • 1.3.0                                ...           6 years ago
  • 1.2.1                                ...           6 years ago
  • 1.2.0                                ...           6 years ago
  • 1.1.0                                ...           6 years ago
  • 1.0.1                                ...           6 years ago
  • 1.0.0-rc.2                                ...           6 years ago
  • 1.0.0-rc.1                                ...           6 years ago
  • 1.0.0-beta.8                                ...           6 years ago
  • 1.0.0-beta.7                                ...           6 years ago
  • 1.0.0-beta.6                                ...           7 years ago
  • 1.0.0-beta.5.1                                ...           7 years ago
  • 1.0.0-beta.5                                ...           7 years ago
  • 1.0.0-beta.4                                ...           7 years ago
  • 1.0.0-beta.3                                ...           7 years ago
  • 1.0.0-beta.2                                ...           7 years ago
  • 1.0.0-beta.1                                ...           7 years ago
  • 0.25.0                                ...           7 years ago
  • 0.24.0                                ...           7 years ago
  • 0.23.0                                ...           7 years ago
  • 0.22.0                                ...           7 years ago
  • 0.21.0                                ...           7 years ago
  • 0.20.0                                ...           7 years ago
  • 0.19.1                                ...           8 years ago
  • 0.19.0                                ...           8 years ago
  • 0.18.2                                ...           8 years ago
  • 0.18.1                                ...           8 years ago
  • 0.18.0                                ...           8 years ago
  • 0.17.0                                ...           8 years ago
  • 0.16.0                                ...           8 years ago
  • 0.15.2                                ...           9 years ago
  • 0.15.1                                ...           9 years ago
  • 0.15.0                                ...           9 years ago
  • 0.14.0                                ...           9 years ago
  • 0.13.0                                ...           9 years ago
  • 0.12.0                                ...           9 years ago
  • 0.11.0                                ...           9 years ago
  • 0.10.0                                ...           9 years ago
  • 0.9.2                                ...           9 years ago
  • 0.9.1                                ...           9 years ago
  • 0.9.0                                ...           9 years ago
  • 0.8.0                                ...           9 years ago
  • 0.7.0                                ...           9 years ago
  • 0.6.1                                ...           9 years ago
  • 0.6.0                                ...           9 years ago
  • 0.5.0                                ...           9 years ago
  • 0.4.2                                ...           9 years ago
  • 0.4.1                                ...           9 years ago
  • 0.4.0                                ...           9 years ago
  • 0.3.0                                ...           9 years ago
  • 0.2.0                                ...           9 years ago
  • 0.1.0                                ...           9 years ago
  • 0.0.4                                ...           10 years ago
  • 0.0.3                                ...           10 years ago
Downloads
Total 28
Today 0
This Week 0
This Month 20
Last Day 0
Last Week 20
Last Month 8
Dependencies (40)
Dev Dependencies (15)

© 2010 - cnpmjs.org x YWFE | Home | YWFE