


It shows all the properties of a json object, for example, if you hover it with the mouse pointer. When you run the tests and at least one of the tests access this part of the code, the debugger will stop there and show the current state of the variable(s) in the line where you put the breakpoint. This is the result of the tests running inside Visual Studio Code using Mocha:īefore running the debugger, you can also set a breakpoint in the code by clicking on the line you want, before the line number. If there’s no bin directory yet with the transpiled TypeScript, then you’ll have to run gulp before to create it and run the gulp tasks. When you click on the play button it will start running the tests inside the bin/test directory, if you followed the configuration I created on my previous post about testing with Mocha. Ps: If this directory is not there, then open the Debug view inside Visual Studio Code (Ctrl + Shift + D) so the option to create it will be presented to you.Īfter saving this file with the Mocha options, when you go to the Debug view, you’ll see “Run mocha” as one of the options for running the debugger. Open the launch.json file inside of it and add the Mocha settings: 1 Inside the project you opened in Visual Studio Code, there’s a directory called.

Configuring a new launch for debugging our Node.js system This post is based on the configuration we did in the previous post, which was about testing with Mocha. A task can be configured to transpile our TypeScript files to JavaScript automatically, as soon as we change them. Visual Studio Code comes with settings to launch node or mocha executables in order to debug our systems, and also with tasks.
