Testing with node:test
Node.js introduced a built-in test runner in version 18 as an experimental feature, subsequently making it stable in version 20. This addition marked a significant shift in the Node.js runtime development philosophy away from the “small core” to adding more utilities into the runtime itself.
The decision to include a built-in test runner was influenced by a broader industry trend toward including more built-in tooling in programming languages and runtimes. This shift is partly in response to concerns about security, such as the risks associated with dependency vulnerabilities. By providing a native test solution, Node.js aims to make testing a first-class citizen within its environment, reducing the potential attack surface provided by third-party test runners.
The built-in test runner in Node.js does not have as extensive an API as is provided by the many common and popular test frameworks, such as Jest. It was designed to be a minimal and...