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 let smartci = require("smartci");
export import smartcli = require("smartcli");
export let smartcov = require("smartcov");
export import smartcov = require("smartcov");
export import smartenv = require("smartenv");
export import smartfile = require("smartfile");
export import smartpath = require("smartpath");

View File

@ -45,17 +45,15 @@ let mocha = function (configArg) {
let coverage = function(configArg){
let 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
`${percentageArg.toString()}% coverage exceeds your treshold of ${configArg.coverageTreshold.toString()}%`
);
} else {
plugins.beautylog.warn(
"your coverage of " + percentageArg + "% " + "fails your treshold of " +
configArg.coverageTreshold + "%"
`${percentageArg.toString()}% coverage fails your treshold of ${configArg.coverageTreshold.toString()}%`
);
plugins.beautylog.error("exiting due to coverage failure");
process.exit(1);