🧪
Testing300K+/wkMIT

ava

AVA is a minimalist test runner for Node.js that runs tests concurrently, achieving fast test execution by leveraging the asynchronous nature of JavaScript. AVA

Installation

npm
npm install -D ava
yarn
yarn add -D ava
pnpm
pnpm add -D ava

Import

ESM
import test from 'ava';

Quick Example

usage
import test from 'ava';

test('adds numbers', (t) => {
  t.is(1 + 2, 3);
});

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

About ava

AVA is a minimalist test runner for Node.js that runs tests concurrently, achieving fast test execution by leveraging the asynchronous nature of JavaScript. AVA runs each test file in its own worker thread, and tests within a file run concurrently by default, encouraging developers to write tests that are truly isolated and do not depend on shared state. The framework has a simple, concise API with built-in assertion methods powered by the power-assert library, which provides detailed failure messages showing the values of all sub-expressions in failed assertions. AVA supports TypeScript natively, async/await, Observable testing, and snapshot testing. The test function receives a test object (t) with assertion methods: t.is(), t.deepEqual(), t.throws(), t.truthy(), and others. AVA uses ES modules by default and does not create global variables, requiring explicit imports. The framework provides .before(), .after(), .beforeEach(), and .afterEach() hooks, test macros for reusable test logic, and a watch mode that re-runs only affected tests. AVA is maintained by Sindre Sorhus and is designed for developers who prefer minimalism and fast execution.

Quick Facts

Packageava
CategoryTesting
Weekly Downloads300K+
LicenseMIT
Installnpm install -D ava

Related Packages

Browse npm Packages by Category

Explore our reference of 200 popular npm packages with install commands, examples, and quick-start guides.