Since Node 18+, `node:test` provides a built-in test runner with `test()`, `describe()`/`it()`, and an `assert` module, runnable via `node --test`.
js
import { test } from "node:test";
import assert from "node:assert/strict";
function add(a, b) { return a + b; }
test("add sums two numbers", () => {
assert.equal(add(2, 3), 5);
});
test("add handles negatives", () => {
assert.equal(add(-1, 1), 0);
});Running `node --test` auto-discovers files matching common test naming patterns (`*.test.js`) and reports pass/fail with a TAP-compatible summary — useful for small projects that want tests without adding Jest or Vitest as a dependency.