From ee16740d0be3af832902777b9d34ef18d7eee653 Mon Sep 17 00:00:00 2001 From: PhilKunz Date: Sat, 23 Jul 2016 02:05:56 +0200 Subject: [PATCH] improve coverage reporting --- dist/npmts.plugins.d.ts | 2 +- dist/npmts.tests.js | 8 +++----- package.json | 4 ++-- ts/npmts.plugins.ts | 2 +- ts/npmts.tests.ts | 8 +++----- 5 files changed, 10 insertions(+), 14 deletions(-) diff --git a/dist/npmts.plugins.d.ts b/dist/npmts.plugins.d.ts index dc6280f..7c3925d 100644 --- a/dist/npmts.plugins.d.ts +++ b/dist/npmts.plugins.d.ts @@ -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"); diff --git a/dist/npmts.tests.js b/dist/npmts.tests.js index f5341bd..8dcd538 100644 --- a/dist/npmts.tests.js +++ b/dist/npmts.tests.js @@ -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); } diff --git a/package.json b/package.json index 90d33cc..79f5a0c 100644 --- a/package.json +++ b/package.json @@ -50,10 +50,10 @@ "npmextra": "^1.0.8", "projectinfo": "1.0.3", "q": "^1.4.1", - "shelljs": "^0.7.0", + "shelljs": "^0.7.1", "smartci": "0.0.1", "smartcli": "1.0.4", - "smartcov": "0.0.6", + "smartcov": "0.0.9", "smartenv": "1.2.5", "smartfile": "4.0.12", "smartpath": "3.2.2", diff --git a/ts/npmts.plugins.ts b/ts/npmts.plugins.ts index c0cc489..02a0246 100644 --- a/ts/npmts.plugins.ts +++ b/ts/npmts.plugins.ts @@ -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"); diff --git a/ts/npmts.tests.ts b/ts/npmts.tests.ts index bf30e76..81f8d37 100644 --- a/ts/npmts.tests.ts +++ b/ts/npmts.tests.ts @@ -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);