lcov-parse
Advanced tools
Comparing version 0.0.2 to 0.0.3
@@ -99,11 +99,13 @@ var fs = require('fs'), | ||
}); | ||
cb(null, data); | ||
if (data.length) { | ||
cb(null, data); | ||
} else { | ||
cb('Failed to parse string'); | ||
} | ||
}; | ||
var parse = function(file, cb) { | ||
exists(file, function(x) { | ||
if (!x) { | ||
cb("Failed to find file: " + file); | ||
return; | ||
return walkFile(file, cb); | ||
} | ||
@@ -110,0 +112,0 @@ fs.readFile(file, 'utf8', function(err, str) { |
{ | ||
"name": "lcov-parse", | ||
"description": "Parse lcov results files and return JSON", | ||
"version": "0.0.2", | ||
"version": "0.0.3", | ||
"author": "Dav Glass <davglass@gmail.com>", | ||
@@ -6,0 +6,0 @@ "bugs": { "url" : "http://github.com/davglass/lcov-parse/issues" }, |
@@ -18,2 +18,8 @@ ## LCOV file parser | ||
or | ||
parse(lcovString, function(err, data) { | ||
//process the data here | ||
}); | ||
## Formatting | ||
@@ -20,0 +26,0 @@ |
@@ -25,2 +25,12 @@ var vows = require('vows'), | ||
}, | ||
'Parse as a string': { | ||
topic: function() { | ||
parse('TN:TestName\nSF:foobar.js\nend_of_record\n', this.callback); | ||
}, | ||
'should parse': function(err, data) { | ||
assert.isArray(data); | ||
assert.equal('TestName', data[0].title); | ||
assert.equal('foobar.js', data[0].file); | ||
} | ||
}, | ||
'parse the file': { | ||
@@ -27,0 +37,0 @@ topic: function() { |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
30219
11
204
80
0