Better Node Test (BNT) is a command-line interface (CLI) tool designed to streamline the usage of Node.js's native `node --test` runner. It significantly enhances the testing workflow by providing out-of-the-box support for TypeScript, a convenient `-t` shortcut for filtering and running specific tests by name, and integrated code coverage analysis through the `--coverage` flag. The current stable version is 0.8.4, with releases showing a consistent cadence of minor and patch updates, often addressing compatibility with evolving Node.js features like `strip-types` and robust coverage reporting. BNT differentiates itself by leveraging Node.js's built-in testing capabilities, minimizing reliance on additional third-party test runners, while adding essential developer conveniences like automatic TypeScript compilation and comprehensive coverage reporting tailored for modern Node.js environments.
npm install better-node-testNo compatibility data collected yet for this library.
Demonstrates creating a simple Node.js test file with TypeScript and running it using `better-node-test` with various CLI options, including coverage and test filtering.
Ensure your Node.js environment meets the minimum `engines` requirement. Upgrade Node.js to at least `18.19.0` (or `20.0.0`, `22.0.0`, `24.0.0` for newer features and optimal compatibility) using `nvm` or similar version managers.
Update to a recent stable Node.js version (e.g., 20.x or 22.x) to ensure full compatibility with native test coverage features, or disable the `--coverage` flag if targeting older Node.js environments.
For modern Node.js (>=20.x, 22.x), `better-node-test` should handle TypeScript stripping automatically. Avoid explicitly relying on `--experimental-strip-types` unless specifically troubleshooting or targeting older, unsupported Node.js versions where it was explicitly required.
Update your Node.js environment to a compatible version (e.g., 20.x or 22.x) using `nvm install <version>` or similar version management tools.
Upgrade Node.js to a version that provides robust native test coverage support (e.g., Node.js 20.x or 22.x), or remove the `--coverage` flag if an upgrade is not feasible.
Ensure `better-node-test` is executed via `npx bnt` and that your Node.js version is compatible with its `engines` requirements. Avoid manual `node --loader ts-node` setups when using `bnt`, as `bnt` handles TypeScript compilation internally.
No dependency data recorded yet.