We can't find the internet
Attempting to reconnect
Something went wrong!
Hang in there while we get back on track
Learn About Node.js New Built-in Test Runner
Explore Node.js' new built-in test runner, a powerful tool for writing and running automated tests with ease, featuring a robust set of features and customization options.
- Node.js has a built-in test runner, no installation required
-
Run tests by default in the
testfolder -
Can execute a single file using
node test - Can specify ranges, types, and custom predicates
-
Can mock objects using
esmock - Can generate tests dynamically using functions
- Can write tests in TypeScript
-
Can specify concurrency
truefor testing -
Have a
before eachhook for preparing data -
Can use
chaiassertion library -
Can customize test output using
Faucetreporter - Can skip tests and provide reasons
- Can cancel tests and provide reasons
-
Can run tests in parallel using
experimental - Node.js will have a stable API for tests in version 20