This is a really simple tip, but a load of our developers were kicking off a run of their tests by the command line, and then attaching the VSCode debugger to them to step through. VSCode offers a much easier solution to this.
Instead of doing something like this
then hitting F5 and attaching your debugger to the running process. You can set up a configuration in your launch.json file to debug these by just hitting F5.
But you don’t have to edit the file manually. VSCode does the work for you.
If you go to the debug tab in VSCode on the left hand side, then drop down the list beside the “play” button, you will have the option to “Add Configuration” click this and you will get a list of options.
This will auto populate your launch.json file for you. You can edit the default values here to suit your file structure, and use filters to only run certain files.

This will instantly show up in your “Launch” dropdown beside the play button, and you can add breakpoints and step through your tests easily at the press of a button!
Leave a Reply