I am following this guide to generate javascript coverage report on Ubuntu 13.04:
http://tysonlloydcadenhead.com/blog/javascript-test-coverage-with-jscoverage#.UhnokxIW2Y4
I have installed PhantomJS 1.9.1. I have downloaded JSCover-1.0.3 and extracted it into the root of the workspace. The structure looks like this:
workspace
-> src/core/core.js
-> src/core/parser.js
-> test/coreTest/coreTest.js
-> test/coreTest/parserTest.js
-> JSCover-1.0.3/target/dist/JSCover-all.jar
-> JSCover-1.0.3/src/test/javascript/lib/PhantomJS/run-jscover-qunit.js
-> all_tests.html
First I start the server in the root of the workspace:
workspace$ java -jar JSCover-1.0.3/target/dist/JSCover-all.jar -ws --document-root=. --report-dir=coverage
Next I run the all_tests.html
workspace$ phantomjs JSCover-1.0.3/src/test/javascript/lib/PhantomJS/run-jscover-qunit.js all_tests.htm
'waitFor()' finished in 2457ms.
Tests completed in 2300 milliseconds.
13 assertions of 13 passed, 0 failed.
But when I look in the workspace/coverage dir it only contains (both are empty):
jscover.log
jscover.log.lck
Why is the coverage report not created?
Try
phantomjs JSCover-1.0.3/src/test/javascript/lib/PhantomJS/run-jscover-qunit.js http://localhost:8080/all_tests.htm