To debug javascript code in Webstorm via karma with Jasmine.
preparing-to-use-karma-test-runner
The Karma website
A simple karma.conf.js
file generated with the karma command line tool is ok.
Like this and this
A browser is needed to execute js. Using Chrome we need a JetBrains plugin
Now create a Karma configuration in webstorm with the "Run/Debug Configurations" window.
It is needed to tell Webstorm the karma.conf.js
file to pick.
Select karma in the run/debug config combo box.
Keep the unit test source code file selected in WS.
Add some breakpoints.
Clic on the debug button (or MAJ + F9
)
Enjoy