Imhotap is a lightweight, 'meta-test-framework' designed to run test files as independent processes and aggregate their results. It operates on the principle that each test file should be executable and indicate success or failure via its exit code. The tool automatically detects and parses Test Anything Protocol (TAP) output from test files, but is agnostic to the specific underlying test framework used, supporting any TAP producer like `tape`, `node-tap`, or `pitesti`. Key differentiators include its parallel execution model (defaulting to CPU cores - 1 concurrency), support for custom runners (e.g., `ts-node` for TypeScript files), and flexible glob-based file selection. The current stable version is 2.2.0, with a focus on stability and compatibility rather than frequent breaking changes.
npm install imhotapVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to set up two basic TAP-producing test files (one passing, one failing) and run them with `imhotap` using a glob pattern.
Ensure test files are fully isolated and do not conflict when run simultaneously. If isolation is not feasible, use the `-c 1` option to run tests serially.
Install the runner globally (`npm i -g <runner>`) or locally as a `devDependency` (`npm i -D <runner>`). For local installs, `npx` or a `package.json` script wrapping `imhotap` is recommended.
For non-JavaScript files, use `-R <runner_command>` (e.g., `-R tsnode`, `-R bash`). For executable scripts, ensure they have a shebang (`#!/usr/bin/env bash`) and execute permissions.
Ensure your test framework outputs valid TAP to `stdout`. If your framework outputs to `stderr` and you prefer that, use `--stream stderr`. Consult `testanything.org` for TAP specification.
Ensure the reporter package is installed globally or as a devDependency. If locally installed, ensure `npx` can find it or add it to your PATH.
For shell scripts or other executable formats, run `chmod +x <file>` on the test file. Alternatively, specify a runner using `-R` (e.g., `-R bash` for a shell script).
Double-check the glob pattern for typos or incorrect paths. Ensure files actually exist at the specified location relative to where `imhotap` is run.
No dependency data recorded yet.