My unit tests are run using Karma/Jasmine through Grunt. When I run
grunt test
the tests are executed from command line.
When opening the project in Visual Studio Code, I can run the same command using Tasks: Run Test Task
. VSCode executes Grunt with the test
parameter and shows the output.
How can I debug the test cases that are run by VSCode in this case? When I press F5, the launch.json
template file is opened. What do I need to provide for program
, args
etc. to start/debug the same test cases that are run by grunt test
?
I have tried the following:
program
:/usr/local/bin/grunt
args
:["test"]
This successfully starts the Grunt process and the tests are executed, but it does not stop at the breakpoints in my test code.
In addition to that, it closes (or crashes) the whole VSCode process after a couple of seconds. Not sure whether that's a bug in VSCode or a result of the above run configuration.