Similar to the fragmentation of APIs for sending HTTP requests, testing tooling is also a rich part of the Node.js ecosystem, which comes with advantages and disadvantages.
Many testing frameworks are available and many have seen a rise and fall in adoption over the years. These days our general approach at NearForm is to test purely Node.js code using tap and purely frontend code using Jest .
We're never too prescriptive and we trust our teams to choose what works best for them. As an example, it's very common to see a monorepo containing both frontend and backend code using a single testing framework, because consistency is also an important quality in a codebase.
Node.js 18 introduces a novelty, a new node:test module inspired by tap .
A quick digression on module prefixes is in order.
The node:test module is only available with the node: prefix, and it's the first-ever Node.js module to exhibit this behavior.
Prefixes were introduced to remove ambiguity and risk of loading unintended, possibly malicious, modules.
The API of the testing module is largely similar to that of tap , although many advanced features are still missing, for example module mocks and fixtures .