[Pkg-javascript-commits] [node-mocha-lcov-reporter] 01/03: Imported Upstream version 1.2.0
Julien Puydt
julien.puydt at laposte.net
Sat May 14 06:07:28 UTC 2016
This is an automated email from the git hooks/post-receive script.
jpuydt-guest pushed a commit to branch master
in repository node-mocha-lcov-reporter.
commit 682e47e4be0fa6c4add3df7da41cbd123659b903
Author: Julien Puydt <julien.puydt at laposte.net>
Date: Sat May 14 08:02:29 2016 +0200
Imported Upstream version 1.2.0
---
README.md | 5 +++++
lib/lcov.js | 8 ++++++--
package.json | 2 +-
3 files changed, 12 insertions(+), 3 deletions(-)
diff --git a/README.md b/README.md
index 2da0b68..6d9e579 100644
--- a/README.md
+++ b/README.md
@@ -62,6 +62,11 @@ sed 's,SF:,SF:lib/,' coverage/coverage_temp.lcov > coverage/coverage.lcov
The reason this is that `jscover` runs on the directory you specify (e.g., `lib/`) and regards that as the root for the project.
+Blanket support
+===============
+
+[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`.
+
Example output
==============
diff --git a/lib/lcov.js b/lib/lcov.js
index 34970cd..bdce101 100644
--- a/lib/lcov.js
+++ b/lib/lcov.js
@@ -16,9 +16,13 @@ exports = module.exports = LCov;
function LCov(runner) {
runner.on('end', function(){
- // In a browser context, coverage will be in window.$jscoverage.
+ // In a browser context, coverage will be in window.$jscoverage or window._$blanket.
var g = typeof(global) != 'undefined' ? global : window;
- var cov = g._$jscoverage || {};
+ var cov = g._$jscoverage || g._$blanket;
+ if (!cov) {
+ console.error('mocha-lcov-reporter: No coverage data found, make sure your code is properly instrumented');
+ return;
+ }
for (var filename in cov) {
var data = cov[filename];
diff --git a/package.json b/package.json
index 8162d13..eee7875 100644
--- a/package.json
+++ b/package.json
@@ -1,7 +1,7 @@
{
"name": "mocha-lcov-reporter",
"description": "LCOV reporter for Mocha",
- "version": "1.0.0",
+ "version": "1.2.0",
"author": "Steven Looman <steven.looman at gmail.com>",
"keywords": [ "mocha", "reporter", "lcov", "coverage" ],
"license": "BSD-2-Clause",
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/node-mocha-lcov-reporter.git
More information about the Pkg-javascript-commits
mailing list