Summary
In this chapter, I described the Node.js features for unit testing and debugging.
- Node.js includes a built-in test runner, with support for executing tests and creating mock functions and methods.
- Unit tests for web applications focus on request handling and require mocks of HTTP requests and responses.
- Third-party packages, such as Jest, can be used for projects that require the same test tools for client- and server-side JavaScript code.
- Node.js includes support for debugging, which can be performed with many code editors or with one of the Chromium-based browsers, such as Google Chrome.
In the next part of this book, I demonstrate how Node.js can be used to create the features required for web applications, such as generating dynamic content and authenticating users.