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.

Key takeaways
  • Node.js has a built-in test runner, no installation required
  • Run tests by default in the test folder
  • 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 true for testing
  • Have a before each hook for preparing data
  • Can use chai assertion library
  • Can customize test output using Faucet reporter
  • 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