One of the features that modern editors provide is the ability to debug code interactively, which allows the developer to be more productive and find out what happens when code fails and when troubleshooting occurs.
This section is going to walk you through how to enable debugging using VS Code. Don't worry—this is rather easy. Just follow the steps as shown:
- To do so, click on the Debug item on the left-hand side of the VS Code toolbar:
Debugging option from VS Code
- Then, click on the drop-down menu and select Add Configuration:
Debug configuration section
- Select () Node.js: Mocha Tests:
Debugging configuration file
After you click on () Node.js: Mocha Tests, a new configuration will be written under the launch.json file with the following information:
{
"version": "0.2.0",
"configurations": [
{
...