In this post, I will show you the detailed steps that are required to convert the JsTestDriver LCOV coverage files to HTML reports. Before reading this post, I recommend you to read this post first “Generating Test Reports using JsTestDriver“.
First of all, you need to download the LCOV visualizer from: http://ltp.sourceforge.net/coverage/lcov.php.
Then install the downloaded rpm file in your Linux Redhat environment using the following command line:
rpm -i lcov-1.9-1.noarch.rpm
After that you can start running the HTML report generation command:
jsTestDriver.conf-coverage.dat file, otherwise you will face the genhtml: ERROR: cannot create directory !
As shown in the previous screenshot, the report covers the three main code coverage criteria:
1. Line coverage (statement coverage) which represents the percentage of the source code statements that are tested.
2. Function coverage which represents the percentage of the functions that are tested.
3. Branch coverage which represents the percentage of code branches that are tested.
I attached here the test report files for your reference.