TAD (Test All) is a minimal JavaScript test suite designed for straightforward unit testing, providing a streamlined experience for developers. It allows organizing tests into a dedicated `_test_` directory, corresponding to main application files. The current stable version is 3.1.1, released in August 2023, with the last major version (3.0.0) released in August 2019. The package generally follows a maintenance cadence with occasional bug fixes and breaking changes tied to Node.js version support or internal feature enhancements. Key differentiators include its simple file-based test discovery, automatic argument injection (`t` for tested module, `a` for assertions, `d` for async completion), and flexible support for synchronous, asynchronous, and nested tests. It extends the UncommonJS assert API with convenience aliases, aiming to reduce boilerplate in test functions. Its primary usage is via a command-line interface, but it also offers a programmatic API for integrating into build systems.
npm install tadVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to set up and programmatically run `tad` tests for a simple module, including synchronous, asynchronous, and nested test structures using CommonJS exports.
Ensure asynchronous tests explicitly call the `d()` callback to signal completion, or manage promises internally without relying on `tad`'s automatic thenable processing for return values.
Upgrade your Node.js runtime to a supported version (Node.js >=0.12 is specified in `package.json`).
Update scripts to use `bin/tad.js` or `npm test` if configured. Rename any test files prefixed with `.` to ensure they are discovered by the runner.
Ensure `d()` is called at the end of every asynchronous test path, including within callbacks or promise chains, to properly terminate the test.
Declare only the arguments truly needed by your test function. For asynchronous tests, always include `d` in the signature.
Organize test files according to `tad`'s convention: `_test_/<module-name>-test.js` for module-specific tests or a top-level `_test_` directory for general tests, and ensure they are discoverable via the CLI path.
Ensure all execution paths in your asynchronous test function explicitly call `d()` once the test logic is complete.
Verify the path passed to `bin/tad.js` (or programmatic `runTests`) is correct, test files adhere to the `_test_` folder convention, and test functions are properly `module.exports` or `exports` in a CommonJS format.
Ensure your test files are interpreted as CommonJS modules by either using the `.js` extension without `type: "module"` in `package.json`, or configure your environment to specifically treat test files as CommonJS.
No dependency data recorded yet.