gemini-coverage
Advanced tools
Comparing version 0.1.0 to 0.2.0
'use strict'; | ||
var PATH = require('path'), | ||
mkReport = require('./'), | ||
coverage = require('./'), | ||
reporters = require('./reporters'); | ||
@@ -39,3 +39,4 @@ | ||
.act(function(opts, args) { | ||
return mkReport(args.path, opts.reporter); | ||
return coverage.mkReport(args.path, opts.reporter) | ||
.thenResolve('Done.'); | ||
}); |
@@ -12,5 +12,14 @@ 'use strict'; | ||
*/ | ||
module.exports = function(path, reporter) { | ||
exports.mkReport = function(path, reporter) { | ||
reporter = reporter || reporters.default(); | ||
return new Scanner(path).resolve(reporters.mk(reporter)); | ||
} | ||
}; | ||
/** | ||
* Get summary for passed coverage statistics | ||
* @param {Object} coverage | ||
* @return {Object} coverage summary | ||
*/ | ||
exports.summarizeCoverage = function(coverage) { | ||
return reporters.mk('summary').get(coverage); | ||
}; |
@@ -8,5 +8,9 @@ 'use strict'; | ||
print: function(diff) { | ||
throw 'Method "print()" must be overridden!'; | ||
throw 'Method "print()" not implemented!'; | ||
}, | ||
get: function(diff) { | ||
throw 'Method "get()" not implemented!'; | ||
} | ||
}); |
@@ -29,5 +29,5 @@ 'use strict'; | ||
return resultFilePath; | ||
console.log(resultFilePath); | ||
} | ||
}); |
@@ -6,3 +6,4 @@ 'use strict'; | ||
number: './number-reporter', | ||
html: './html-reporter' | ||
html: './html-reporter', | ||
summary: './summary-reporter' | ||
}; | ||
@@ -13,3 +14,3 @@ | ||
return Object.keys(REPORTERS); | ||
} | ||
}; | ||
@@ -19,3 +20,3 @@ /// | ||
return 'std'; | ||
} | ||
}; | ||
@@ -30,2 +31,2 @@ /// | ||
return new Reporter(); | ||
} | ||
}; |
@@ -6,14 +6,11 @@ 'use strict'; | ||
BaseReporter = require('./base-reporter'); | ||
SummaryReporter = require('./summary-reporter'); | ||
module.exports = inherit(BaseReporter, { | ||
module.exports = inherit(SummaryReporter, { | ||
print: function(diff) { | ||
return format( | ||
'%s/%s', | ||
diff.covered.length, | ||
diff.notCovered.length + diff.covered.length | ||
); | ||
get: function(diff) { | ||
var summary = this.__base(diff); | ||
return format('%s/%s', summary.covered, summary.total); | ||
} | ||
}); |
@@ -28,5 +28,5 @@ 'use strict'; | ||
return covered.concat(notCovered).join('\n'); | ||
console.log(covered.concat(notCovered).join('\n')); | ||
} | ||
}); |
@@ -154,3 +154,6 @@ 'use strict'; | ||
.flow() | ||
.then(reporter.print.bind(reporter)); | ||
.then(function(coverage) { | ||
reporter.print(coverage); | ||
return coverage; | ||
}); | ||
} | ||
@@ -157,0 +160,0 @@ |
{ | ||
"author": "Tikvach Alexander <unlok@yandex-team.ru>", | ||
"name": "gemini-coverage", | ||
"version": "0.1.0", | ||
"version": "0.2.0", | ||
"repository": { | ||
@@ -6,0 +6,0 @@ "type": "git", |
@@ -23,5 +23,8 @@ # Simple gemini coverage | ||
```js | ||
var mkReport = require('gemini-coverage'); | ||
var geminiCoverage = require('gemini-coverage'); | ||
... | ||
return mkReport(path_to_bem_library, reporter); | ||
return geminiCoverage.mkReport(path_to_bem_library, reporter) | ||
.then(function(coverage) { | ||
console.log(geminiCoverage.summarizeCoverage(coverage)); | ||
}); | ||
``` |
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
38421
24
580
30
0