improve coverage reporting
This commit is contained in:
2
dist/npmts.plugins.d.ts
vendored
2
dist/npmts.plugins.d.ts
vendored
@ -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
8
dist/npmts.tests.js
vendored
@ -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);
|
||||
}
|
||||
|
Reference in New Issue
Block a user