gitmyhub

ava

JavaScript ★ 21k updated 1mo ago

Node.js test runner that lets you develop with confidence 🚀

AVA is a fast, minimal Node.js test runner that runs each test file in its own isolated thread concurrently, with clear failure diffs and built-in support for async JavaScript and TypeScript. It includes CI-aware automatic test splitting.

JavaScriptNode.jsTypeScriptsetup: easycomplexity 2/5

AVA is a test runner for Node.js — a tool that runs automated tests for JavaScript projects. It is designed to be minimal, fast, and focused on reliability. Each test file runs in its own isolated environment (its own thread), which means tests cannot accidentally share state or interfere with each other. Tests also run concurrently by default, making the overall test suite faster than runners that process tests one at a time.

One of AVA's signature features is "magic assert" — when a test fails, AVA shows a clean, syntax-highlighted diff between what was expected and what was actually produced, making it much easier to understand the failure without digging through raw output. It also cleans up stack traces automatically by removing unrelated internal lines, so errors point more directly to the code you wrote. AVA supports modern JavaScript including async functions, Promises, and Observables, and ships with TypeScript type definitions included.

For teams using continuous integration services, AVA can automatically detect whether a CI environment supports parallel builds and splits the test files across build workers so all tests still run but faster. Installation is straightforward via npm or Yarn, and the documentation covers writing tests, snapshot testing, the command line interface, configuration, and various testing recipes for common scenarios like endpoint testing, browser testing, and code coverage.

Where it fits