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.

Comments:

how would u go about setting this up in project where it is not like a pure html5 and angularjs i.e a maven project?

Posted by guest on October 28, 2014 at 07:52 AM PDT #

Post a Comment:
  • HTML Syntax: NOT allowed
About

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.

Search

Archives
« March 2015
SunMonTueWedThuFriSat
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
    
       
Today