improve coverage reporting

This commit is contained in:
2016-07-23 02:05:56 +02:00
parent 63c73536a2
commit ee16740d0b
5 changed files with 10 additions and 14 deletions

View File

@ -19,7 +19,7 @@ export import Q = require("q");
export import shelljs = require("shelljs");
export declare let smartci: any;
export import smartcli = require("smartcli");
export declare let smartcov: any;
export import smartcov = require("smartcov");
export import smartenv = require("smartenv");
export import smartfile = require("smartfile");
export import smartpath = require("smartpath");

8
dist/npmts.tests.js vendored
View File

@ -43,15 +43,13 @@ var mocha = function (configArg) {
};
var coverage = function (configArg) {
var done = plugins.Q.defer();
plugins.smartcov.get.percentage(plugins.path.join(paths.coverageDir, "lcov.info"))
plugins.smartcov.get.percentage(plugins.path.join(paths.coverageDir, "lcov.info"), 2)
.then(function (percentageArg) {
if (percentageArg >= configArg.coverageTreshold) {
plugins.beautylog.ok("your coverage of " + percentageArg.toString().blue + "% ".blue + "exceeds your treshold of " +
configArg.coverageTreshold.toString().blue + "%".blue);
plugins.beautylog.ok(percentageArg.toString() + "% coverage exceeds your treshold of " + configArg.coverageTreshold.toString() + "%");
}
else {
plugins.beautylog.warn("your coverage of " + percentageArg + "% " + "fails your treshold of " +
configArg.coverageTreshold + "%");
plugins.beautylog.warn(percentageArg.toString() + "% coverage fails your treshold of " + configArg.coverageTreshold.toString() + "%");
plugins.beautylog.error("exiting due to coverage failure");
process.exit(1);
}