Search code examples
angularjsjasminekarma-runnerwebstorm

Debug unit testcases with breakpoints while executing gulp


Is it possible to debug unit testcases written using jasmine(for eg: filename.spec.js) with breakpoints in webstorm editor while executing the gulp command "gulp test".

I am using phantomjs as browser in karma.conf file.

Breakpoints which I have kept are not hitting but testcases executing successfully.Kindly provide some suggestions.


Solution

  • In webstorm 11.0.1 to debug the unit testcases by breakpoints for development purpose.

    Run -> Edit configurations

    click the plus sign and select karma

    1) Give a desired name to the configuration(for eg:Karma Debug)

    2) select your karma config file from the drop down

    3) Browsers to start(Chrome) and click apply

    In chrome browser install the jetbrains IDE support extension and put breakpoints in your unit testcases.

    finally DEBUG using the created configuration(Karma Debug).