ava
's direct dependencies. Data on all dependencies, including transitive ones, is available via CSV download.Name | Version | Size | License | Type | Vulnerabilities |
---|---|---|---|---|---|
acorn-walk | 8.3.2 | 9.29 kB | MIT | prod | |
acorn | 8.11.3 | 122.89 kB | MIT | prod | |
ansi-styles | 6.2.1 | 5.66 kB | MIT | prod | |
arrgv | 1.0.2 | 3.13 kB | MIT | prod | |
arrify | 3.0.0 | 1.83 kB | MIT | prod | |
callsites | 4.1.0 | 2.53 kB | MIT | prod | |
cbor | 8.1.0 | 38.82 kB | MIT | prod | |
chalk | 5.3.0 | 13.08 kB | MIT | prod | |
chokidar | 3.6.0 | 25.83 kB | MIT | prod | |
chunkd | 2.0.1 | 2.03 kB | MIT | prod | |
ci-info | 3.9.0 | 7.21 kB | MIT | prod | |
ci-parallel-vars | 1.0.1 | 2.15 kB | MIT | prod | |
clean-yaml-object | 0.1.0 | 2.66 kB | MIT | prod | |
cli-truncate | 3.1.0 | 3.45 kB | MIT | prod | |
code-excerpt | 4.0.0 | 2.06 kB | MIT | prod | |
common-path-prefix | 3.0.0 | 1.92 kB | ISC | prod | |
concordance | 5.0.4 | 33.78 kB | ISC | prod | |
currently-unhandled | 0.4.1 | 2.45 kB | MIT | prod | |
debug | 4.3.4 | 12.94 kB | MIT | prod | |
emittery | 1.0.3 | 45.47 kB | MIT | prod | |
figures | 5.0.0 | 7.3 kB | MIT | prod | |
globby | 13.2.2 | 6.82 kB | MIT | prod | |
ignore-by-default | 2.1.0 | 1.68 kB | ISC | prod | |
indent-string | 5.0.0 | 2.18 kB | MIT | prod | |
is-error | 2.2.2 | 2.67 kB | MIT | prod | |
is-plain-object | 5.0.0 | 3.33 kB | MIT | prod | |
is-promise | 4.0.0 | 1.58 kB | MIT | prod | |
matcher | 5.0.0 | 3.81 kB | MIT | prod | |
mem | 9.0.2 | 5.58 kB | MIT | prod | |
ms | 2.1.3 | 2.9 kB | MIT | prod | |
p-event | 5.0.1 | 5.9 kB | MIT | prod | |
p-map | 5.5.0 | 5.27 kB | MIT | prod | |
picomatch | 2.3.1 | 23.72 kB | MIT | prod | |
pkg-conf | 4.0.0 | 2.96 kB | MIT | prod | |
plur | 5.1.0 | 2.13 kB | MIT | prod | |
pretty-ms | 8.0.0 | 3.66 kB | MIT | prod | |
resolve-cwd | 3.0.0 | 1.91 kB | MIT | prod | |
stack-utils | 2.0.6 | 5.34 kB | MIT | prod | |
strip-ansi | 7.1.0 | 2.12 kB | MIT | prod | |
supertap | 3.0.1 | 3.09 kB | MIT | prod | |
temp-dir | 3.0.0 | 1.6 kB | MIT | prod | |
write-file-atomic | 5.0.1 | 4.3 kB | ISC | prod | |
yargs | 17.7.2 | 64.15 kB | MIT | prod |
AVA is a powerful test runner for Node.js projects. It provides a concise API and detailed error output, embracing new language features and process isolation. This enables developers to write tests in an efficient and confident manner. AVA runs tests concurrently, enforces the writing of atomic tests, and provides no implicit globals. This results is minimal, fast tests and outputs that are simple to understand, allowing developers to troubleshoot and resolve errors quickly. AVA also includes TypeScript definitions and features such as Magic Assert for clearer, focused assertion messages, and an isolated environment for each test file for better control.
To use AVA effectively, first, install it to your Node.js project. You can easily setup AVA by running npm init ava
in your console. This configures AVA in your package.json
file. Alternatively, if you prefer Yarn, use yarn add ava --dev
, or install AVA manually via npm install --save-dev ava
.
Once installed, create a test file at the project root directory, for example test.js
, and import the test module:
import test from 'ava';
test('foo', t => {
t.pass();
});
test('bar', async t => {
const bar = Promise.resolve('bar');
t.is(await bar, 'bar');
});
Now you can run your tests with the command npm test
, or if you're using npx, with the command npx ava
. To run your tests in watch mode, use the command npx ava --watch
.
The documentation for AVA is located in the "docs" directory of the AVA repository on GitHub. The documentation provides thorough information on various aspects of AVA, including writing tests, execution context, assertions, snapshot testing, command line (CLI) interface, and configuration. AVA also has a list of common pitfalls that developers may encounter while using AVA, as well as a diverse collection of useful recipes for specific situations. Ava's documentation can be found via this link. Feel free to explore these resources to get a better understanding of AVA and how to make the most of its features and capabilities.