Sunday Jul 27, 2014

Karma: Debugging JavaScript Unit Tests

In NetBeans IDE 8.0, you're able to debug JavaScript unit tests via JS Test Driver. In the upcoming NetBeans IDE 8.0.1, JavaScript unit test debugging has been extended to include Karma, as well.

Right-click an HTML5 project and, when you select Karma in the JavaScript Testing tab, you can enable debugging, as shown below. (The new Karma Istanbul code coverage integration was discussed in this blog yesterday.) 

As you can see below, the drop-down lets you choose on which device you want to debug your unit tests:

Then, on the Karma node of your project, enable debugging and start Karma:

Then you can follow the steps in "Debugging a JS Unit Test with JS Test Driver" in the NetBeans tutorial Debugging and Testing JavaScript in an HTML5 Application, with the result shown below, click to enlarge the image.


Geertjan Wielenga (@geertjanw) is a Principal Product Manager in the Oracle Developer Tools group living & working in Amsterdam. He is a Java technology enthusiast, evangelist, trainer, speaker, and writer. He blogs here daily.

The focus of this blog is mostly on NetBeans (a development tool primarily for Java programmers), with an occasional reference to NetBeans, and sometimes diverging to topics relating to NetBeans. And then there are days when NetBeans is mentioned, just for a change.


« July 2014 »