Japa is a lean and fast Node.js test runner designed for both testing applications and for building custom test runners. The current stable version is v10.4.0, with minor and patch releases occurring frequently—typically several times a quarter—and major versions released periodically as breaking changes are introduced. A key differentiator is its minimal core, offering faster boot times compared to alternatives like Mocha or Ava, primarily because it does not ship with its own CLI; tests are executed directly as standard Node.js scripts. Japa supports ES6 async/await syntax, ES modules, test groups with lifecycle hooks, regression tests, and offers an extensible assertion system often utilized via plugins. Its design philosophy emphasizes simplicity and provides the foundational components for highly customized testing environments.
npm install japaVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates basic Japa tests, organizes them into groups with lifecycle hooks, configures the `@japa/assert` plugin for assertions, and shows how to programmatically run tests.
Review and update custom test reporters to adapt to the new emitter event structure for regression tests.
Modify any code accessing test titles from emitter events to use `event.title.original` or `event.title.expanded`.
Ensure your project's `package.json` scripts or CI configurations directly invoke test files using `node` or a custom runner built on Japa.
Understand the implications of `bail` mode for your workflow. If full test suite execution is always required, ensure `bail` mode is not enabled. Review specific patch notes for `bail` related fixes if encountering unexpected behavior on versions between 10.0.0 and 10.3.0.
Install `@japa/assert` (`npm i -D @japa/assert`) and register it as a plugin in your Japa configuration (e.g., `test.configure({ plugins: [assert()] })`) to enable the `assert` object in your test callbacks.For ESM, ensure you use `import test from 'japa'`. For CommonJS, use `const test = require('japa')`.Verify that `test` is correctly imported as the primary export of the `japa` package. For ESM: `import test from 'japa'`. For CJS: `const test = require('japa')`.Optimize the test's execution time, increase the timeout duration using `test.timeout(ms)` or `group.timeout(ms)`, and ensure all asynchronous operations within the test are properly awaited.
No dependency data recorded yet.