It's always a good practice to know about code coverage in your project. In very simple words, code coverage can be thought as the code which is tested. A higher code coverage means that the code written is carefully tested and leads to a minimal chance of occurrence of bugs. A code with the lower coverage can lead to frequent bugs since it was not properly tested.
JsTestDriver has coverage plugin available to generate a report for your project. In the jsTestDriver.conf
file, we need to add coverage plugin to generate the report:
server: http://localhost:9880 load: - lib/jasmine-1.1.0/jasmine.js - lib/adapter/JasmineAdapter.js - lib/jquery.1.11.3.min.js - src/*.js test: - src-test/*.js plugin: - name: "coverage" jar: "lib/coverage-1.3.5.jar" module: "com.google.jstestdriver.coverage.CoverageModule"
After this, we also need to specify the output directory using the --testOutput
flag. If we choose D:/HelloWorldAppOutput
as output directory, then our command...