8

Unit Testing and Debugging

In this chapter, I describe the features that Node.js provides for testing and debugging JavaScript code. I begin by demonstrating the Node.js integrated test runner, which makes it easy to define and execute unit tests. I continue by demonstrating the Node.js debugger, which is integrated into the JavaScript runtime but used through external tools. Table 8.1 puts testing and debugging in context.

Table 8.1: Putting testing and debugging in context

Question

Answer

What is it?

Unit testing is the process of defining and running tests that check the behavior of code. Debugging is the process of inspecting the state of the application as it is executed to determine the cause of unexpected or undesirable ...

Get Mastering Node.js Web Development now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.