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 install -D ava
yarn add -D ava
pnpm add -D ava
Import
import test from 'ava';
Quick Example
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
| Package | ava |
| Category | Testing |
| Weekly Downloads | 300K+ |
| License | MIT |
| Install | npm install -D ava |
Related Packages
Jest is a delightful JavaScript testing framework with a focus on simplicity, created by Facebook. I…
tap (Test Anything Protocol) is a comprehensive test framework for Node.js that produces output conf…
Vitest is a blazing-fast unit testing framework powered by Vite, designed as a modern alternative to…
Mocha is a feature-rich JavaScript test framework that runs on Node.js and in the browser, providing…
Sinon.js provides standalone test spies, stubs, and mocks for JavaScript that work with any test fra…
Browse npm Packages by Category
Explore our reference of 200 popular npm packages with install commands, examples, and quick-start guides.