Hi,
I am working on adding unit tests for a client application developed using AngularJS. I am using Karma with Jasmine to add unit test and ultimate goal is to generate code coverage for the same using Istanbul code coverage tool which is the default coverage tool with Karma. Attached is the karma.conf.js file that I am using.
Currently, I am instrumenting only a single file (the archived-chat.js) using 'coverage' tag and have included a test case using Jasmine for this file.
The test runs successfully using Karma and it also generates code coverage report in coverage folder. I am able to get the line, function, branch coverage etc. in percentage.
However, when I click on the link to view the line by line coverage for the individual file, it opens up the html for the file which doesn't have any red/green marking to show what is covered and what is not covered. Please have a look at the attached html file. I am expecting it to show green/red marking and display line by line coverage.
Can someone throw some light as to what I am missing? Any help in this regard is greatly appreciated.
Some more information:
This is the folder structure of my application: I am running karma from the tests folder...
-ipocc-ui-chromeapp
-app
-scripts //app source files reside in here
-controllers //app controller source files (this is angularJS terminology)
-services //app services source files (this is angularJS terminology)
-tests // jasmine tests and karma.conf.js reside here
-node-modules //local karma and plug-ins installation
Versions of karma and other plug-ins:
karma 0.12.36
karma-jasmine 0.3.5
karma-coverage 0.4.2
istanbul 0.3.15