{"_id":"mocha-lcov-reporter","_rev":"2787413","name":"mocha-lcov-reporter","description":"LCOV reporter for Mocha","dist-tags":{"latest":"1.3.0"},"maintainers":[{"name":"steven.looman","email":"steven.looman@gmail.com"}],"time":{"modified":"2022-06-22T03:09:01.000Z","created":"2012-07-03T19:52:34.484Z","1.3.0":"2017-02-21T17:42:29.492Z","1.2.0":"2016-02-21T10:48:05.861Z","1.1.0":"2016-02-17T19:29:10.339Z","1.0.0":"2015-09-22T11:10:18.350Z","0.0.2":"2015-02-26T17:39:15.825Z","0.0.1":"2012-07-03T19:52:34.484Z"},"users":{},"author":{"name":"Steven Looman","email":"steven.looman@gmail.com"},"repository":{"type":"git","url":"git://github.com/StevenLooman/mocha-lcov-reporter.git"},"versions":{"1.3.0":{"name":"mocha-lcov-reporter","description":"LCOV reporter for Mocha","version":"1.3.0","author":{"name":"Steven Looman","email":"steven.looman@gmail.com"},"keywords":["mocha","reporter","lcov","coverage"],"license":"BSD-2-Clause","dependencies":{},"devDependencies":{},"directories":{"lib":"./lib"},"main":"index.js","engines":{"node":">= 0.6.0"},"scripts":{},"repository":{"type":"git","url":"git://github.com/StevenLooman/mocha-lcov-reporter.git"},"gitHead":"a6d38a2db85fc40f8a1b534aedee62d34858cbaa","bugs":{"url":"https://github.com/StevenLooman/mocha-lcov-reporter/issues"},"homepage":"https://github.com/StevenLooman/mocha-lcov-reporter#readme","_id":"mocha-lcov-reporter@1.3.0","_shasum":"469bdef4f8afc9a116056f079df6182d0afb0384","_from":".","_npmVersion":"2.15.11","_nodeVersion":"4.7.3","_npmUser":{"name":"steven.looman","email":"steven.looman@gmail.com"},"maintainers":[{"name":"steven.looman","email":"steven.looman@gmail.com"}],"dist":{"shasum":"469bdef4f8afc9a116056f079df6182d0afb0384","size":3752,"noattachment":false,"key":"/mocha-lcov-reporter/-/mocha-lcov-reporter-1.3.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/mocha-lcov-reporter/download/mocha-lcov-reporter-1.3.0.tgz"},"_npmOperationalInternal":{"host":"packages-18-east.internal.npmjs.com","tmp":"tmp/mocha-lcov-reporter-1.3.0.tgz_1487698948793_0.5392183961812407"},"publish_time":1487698949492,"_hasShrinkwrap":false,"_cnpm_publish_time":1487698949492,"_cnpmcore_publish_time":"2021-12-16T15:46:59.275Z"},"1.2.0":{"name":"mocha-lcov-reporter","description":"LCOV reporter for Mocha","version":"1.2.0","author":{"name":"Steven Looman","email":"steven.looman@gmail.com"},"keywords":["mocha","reporter","lcov","coverage"],"license":"BSD-2-Clause","dependencies":{},"devDependencies":{},"directories":{"lib":"./lib"},"main":"index.js","engines":{"node":">= 0.6.0"},"scripts":{},"repository":{"type":"git","url":"git://github.com/StevenLooman/mocha-lcov-reporter.git"},"gitHead":"6eb43d0ddeef122545f891da7ca1328d3c7e9fa3","bugs":{"url":"https://github.com/StevenLooman/mocha-lcov-reporter/issues"},"homepage":"https://github.com/StevenLooman/mocha-lcov-reporter#readme","_id":"mocha-lcov-reporter@1.2.0","_shasum":"8f7ba1512ae1271611d927669d99b6c2e99f058f","_from":".","_npmVersion":"2.14.12","_nodeVersion":"4.3.1","_npmUser":{"name":"steven.looman","email":"steven.looman@gmail.com"},"maintainers":[{"name":"steven.looman","email":"steven.looman@gmail.com"}],"dist":{"shasum":"8f7ba1512ae1271611d927669d99b6c2e99f058f","size":3437,"noattachment":false,"key":"/mocha-lcov-reporter/-/mocha-lcov-reporter-1.2.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/mocha-lcov-reporter/download/mocha-lcov-reporter-1.2.0.tgz"},"_npmOperationalInternal":{"host":"packages-9-west.internal.npmjs.com","tmp":"tmp/mocha-lcov-reporter-1.2.0.tgz_1456051681105_0.7879984932951629"},"publish_time":1456051685861,"_hasShrinkwrap":false,"_cnpm_publish_time":1456051685861,"_cnpmcore_publish_time":"2021-12-16T15:46:59.480Z"},"1.1.0":{"name":"mocha-lcov-reporter","description":"LCOV reporter for Mocha","version":"1.1.0","author":{"name":"Steven Looman","email":"steven.looman@gmail.com"},"keywords":["mocha","reporter","lcov","coverage"],"license":"BSD-2-Clause","dependencies":{},"devDependencies":{},"directories":{"lib":"./lib"},"main":"index.js","engines":{"node":">= 0.6.0"},"scripts":{},"repository":{"type":"git","url":"git://github.com/StevenLooman/mocha-lcov-reporter.git"},"gitHead":"aef103c6fa389dcec3556414e13656f6e8e07db6","bugs":{"url":"https://github.com/StevenLooman/mocha-lcov-reporter/issues"},"homepage":"https://github.com/StevenLooman/mocha-lcov-reporter#readme","_id":"mocha-lcov-reporter@1.1.0","_shasum":"d7182e3d56a5601da1ce4919c777940509191c78","_from":".","_npmVersion":"2.14.12","_nodeVersion":"4.3.1","_npmUser":{"name":"steven.looman","email":"steven.looman@gmail.com"},"maintainers":[{"name":"steven.looman","email":"steven.looman@gmail.com"}],"dist":{"shasum":"d7182e3d56a5601da1ce4919c777940509191c78","size":3389,"noattachment":false,"key":"/mocha-lcov-reporter/-/mocha-lcov-reporter-1.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/mocha-lcov-reporter/download/mocha-lcov-reporter-1.1.0.tgz"},"_npmOperationalInternal":{"host":"packages-9-west.internal.npmjs.com","tmp":"tmp/mocha-lcov-reporter-1.1.0.tgz_1455737345575_0.9996292174328119"},"publish_time":1455737350339,"_hasShrinkwrap":false,"_cnpm_publish_time":1455737350339,"_cnpmcore_publish_time":"2021-12-16T15:46:59.652Z"},"1.0.0":{"name":"mocha-lcov-reporter","description":"LCOV reporter for Mocha","version":"1.0.0","author":{"name":"Steven Looman","email":"steven.looman@gmail.com"},"keywords":["mocha","reporter","lcov","coverage"],"license":"BSD-2-Clause","dependencies":{},"devDependencies":{},"directories":{"lib":"./lib"},"main":"index.js","engines":{"node":">= 0.6.0"},"scripts":{},"repository":{"type":"git","url":"git://github.com/StevenLooman/mocha-lcov-reporter.git"},"gitHead":"0ead2ec66f01c9392f9ed68591cea8e80ffafb8d","bugs":{"url":"https://github.com/StevenLooman/mocha-lcov-reporter/issues"},"homepage":"https://github.com/StevenLooman/mocha-lcov-reporter","_id":"mocha-lcov-reporter@1.0.0","_shasum":"cf0dda2b06099d88048b6c11d562282630b49cbf","_from":".","_npmVersion":"1.4.28","_npmUser":{"name":"steven.looman","email":"steven.looman@gmail.com"},"maintainers":[{"name":"steven.looman","email":"steven.looman@gmail.com"}],"dist":{"shasum":"cf0dda2b06099d88048b6c11d562282630b49cbf","size":3243,"noattachment":false,"key":"/mocha-lcov-reporter/-/mocha-lcov-reporter-1.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/mocha-lcov-reporter/download/mocha-lcov-reporter-1.0.0.tgz"},"publish_time":1442920218350,"_hasShrinkwrap":false,"_cnpm_publish_time":1442920218350,"_cnpmcore_publish_time":"2021-12-16T15:46:59.815Z"},"0.0.2":{"name":"mocha-lcov-reporter","description":"LCOV reporter for Mocha","version":"0.0.2","author":{"name":"Steven Looman","email":"steven.looman@gmail.com"},"keywords":["mocha","reporter","lcov","coverage"],"licenses":[{"type":"2-clause BSD","url":"https://raw.github.com/StevenLooman/mocha-lcov-reporter/master/LICENSE"}],"dependencies":{},"devDependencies":{},"directories":{"lib":"./lib"},"main":"index.js","engines":{"node":">= 0.6.0"},"scripts":{},"repository":{"type":"git","url":"git://github.com/StevenLooman/mocha-lcov-reporter.git"},"gitHead":"249677249c87e96b70dafe09d9192410db0ad65c","bugs":{"url":"https://github.com/StevenLooman/mocha-lcov-reporter/issues"},"homepage":"https://github.com/StevenLooman/mocha-lcov-reporter","_id":"mocha-lcov-reporter@0.0.2","_shasum":"add13ad24158431570cada442c614edc5e4feb95","_from":".","_npmVersion":"1.4.28","_npmUser":{"name":"steven.looman","email":"steven.looman@gmail.com"},"maintainers":[{"name":"steven.looman","email":"steven.looman@gmail.com"}],"dist":{"shasum":"add13ad24158431570cada442c614edc5e4feb95","size":3281,"noattachment":false,"key":"/mocha-lcov-reporter/-/mocha-lcov-reporter-0.0.2.tgz","tarball":"http://registry.cnpm.dingdandao.com/mocha-lcov-reporter/download/mocha-lcov-reporter-0.0.2.tgz"},"publish_time":1424972355825,"_hasShrinkwrap":false,"_cnpm_publish_time":1424972355825,"_cnpmcore_publish_time":"2021-12-16T15:47:00.096Z"},"0.0.1":{"name":"mocha-lcov-reporter","description":"LCOV reporter for Mocha","version":"0.0.1","author":{"name":"Steven Looman","email":"steven.looman@gmail.com"},"keywords":["mocha","reporter","lcov","coverage"],"licenses":[{"type":"2-clause BSD","url":"https://raw.github.com/StevenLooman/mco/master/LICENSE"}],"dependencies":{},"devDependencies":{},"directories":{"lib":"./lib"},"main":"index.js","engines":{"node":">= 0.6.0"},"scripts":{},"repository":{"type":"git","url":"git://github.com/StevenLooman/mocha-lcov-reporter.git"},"_id":"mocha-lcov-reporter@0.0.1","dist":{"shasum":"02670491db57ee6cb1fe7392e813700f6e336a21","size":2005,"noattachment":false,"key":"/mocha-lcov-reporter/-/mocha-lcov-reporter-0.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/mocha-lcov-reporter/download/mocha-lcov-reporter-0.0.1.tgz"},"maintainers":[{"name":"steven.looman","email":"steven.looman@gmail.com"}],"publish_time":1341345154484,"_hasShrinkwrap":false,"_cnpm_publish_time":1341345154484,"_cnpmcore_publish_time":"2021-12-16T15:47:00.307Z"}},"readme":"mocha-lcov-reporter\n===================\n\nLCOV reporter for Mocha.\n\nLCOV format can be found in this [geninfo manpage](http://ltp.sourceforge.net/coverage/lcov/geninfo.1.php). This LCOV reporter was built after [Sonar Javascript Plugin LCOVParser class](https://github.com/SonarCommunity/sonar-javascript/blob/master/sonar-javascript-plugin/src/main/java/org/sonar/plugins/javascript/lcov/LCOVParser.java).\n\nUsage\n=====\n\nThe mocha-lcov-reporter is a reporter for mocha. In order to get coverage data, the same instructions are to be followed as for the `JSONCov` and `HTMLCov` reporters:\n\n- Install [jscover](https://github.com/node-modules/jscover) or [node-jscoverage](https://github.com/visionmedia/node-jscoverage)\n- Instrument your library with `jscover` (or `node-jscoverage`)\n- Run your tests against your instrumented library and save the output\n\nFor example, the following script can be part of your build process (add `jscover`, `mocha`, and `mocha-lcov-reporter` as `devDependencies` to your `package.json` file and run `npm install`):\n\n```\n#!/usr/bin/env bash\nrm -rf coverage\nrm -rf lib-cov\n\nmkdir coverage\n\nnode_modules/.bin/jscover lib lib-cov\nmv lib lib-orig\nmv lib-cov lib\nnode_modules/.bin/mocha -R mocha-lcov-reporter > coverage/coverage.lcov\nrm -rf lib\nmv lib-orig lib\n```\n\nThis script instruments your sources (source 'lib', target 'lib-cov'), temporarily replaces your library by the instrumented version, run the tests against the instrumented version of your sources, and undoes the replacing of the original library by the instrumented library.\n\nA safer and better approach is to instrument your library (target 'lib-cov'), and include that directory from your tests directly. Instead of doing a 'require(\"../lib\")' do a 'require(\"../lib-cov\")'. This saves the hassle of replacing directory 'lib' with directory 'lib-cov' and undoing it afterwards. You can use an environment variable to check if the instrumented library should be included or the normal version:\n\n```\nvar lib = process.env.JSCOV ? require('../lib-cov') : require('../lib');\n```\n\nAnd to get the test-coverage, run mocha as follows:\n\n```\nJSCOV=1 mocha -R mocha-lcov-reporter > coverage/coverage.lcov\n```\n\nSee the [SaXPath project](https://github.com/StevenLooman/saxpath) for an example on how to do this.\n\nIncomplete paths in LCOV output\n===============================\n\nUnfortunately, when the code is instrumented using `jscover` or `node-jscoverage`, the output of the reporter will have incomplete paths for the covered files. A quick fix is to update the paths after running the tests with the mocha-lcov-reporter, like so:\n\n```\n# run the tests\nJS_COV=1 ./node_modules/.bin/mocha -R mocha-lcov-reporter > coverage/coverage_temp.lcov\n\n# fix the paths\nsed 's,SF:,SF:lib/,' coverage/coverage_temp.lcov > coverage/coverage.lcov\n```\n\nThe reason this is that `jscover` runs on the directory you specify (e.g., `lib/`) and regards that as the root for the project.\n\nBlanket support\n===============\n\n[Blanket.js](http://blanketjs.org/) can be used as well. After the lcov file, be sure to fix the paths for the covered files. The path will be an URL, having `file:` as its protocol. Using the same manner as above, the path can be fixed using `sed`.\n\nExample output\n==============\n\nWhat does LCOV output look like? LCOV is meant to be interpreted by other programs and not meant to be readable by humans. This is an example:\n\n```\nSF:base_unit.js\nDA:1,1\nDA:4,1\nDA:5,155\nDA:7,155\nDA:8,140\nDA:9,140\nDA:12,155\nDA:13,155\nDA:16,1\nDA:17,1\nDA:20,1\nDA:21,9\nDA:24,1\nDA:25,40\nDA:28,1\nDA:29,26\nDA:32,1\nDA:33,7\nDA:36,1\nDA:37,6\nDA:40,1\nDA:41,45\nDA:44,1\nDA:45,52\nDA:51,1\nDA:52,3\nDA:55,1\nend_of_record\n```\n\nIf you are looking for something human readable, the `HTMLCov` reporter can be used.\n","_attachments":{},"homepage":"https://github.com/StevenLooman/mocha-lcov-reporter#readme","bugs":{"url":"https://github.com/StevenLooman/mocha-lcov-reporter/issues"},"license":"BSD-2-Clause"}