fix #17, now computing coverage result correctly
This commit is contained in:
17
dist/mod02/index.js
vendored
17
dist/mod02/index.js
vendored
@ -62,7 +62,7 @@ let tap = function (configArg) {
|
||||
testableFilesSmartstream.run(),
|
||||
testFilesSmartstream.run()
|
||||
]).then(() => __awaiter(this, void 0, void 0, function* () {
|
||||
yield npmtsTapBuffer.runTests();
|
||||
configArg.runData.coverageLcovInfo = yield npmtsTapBuffer.runTests();
|
||||
done.resolve(configArg);
|
||||
}), (err) => {
|
||||
plugins.beautylog.error('Tests failed!');
|
||||
@ -76,15 +76,15 @@ let tap = function (configArg) {
|
||||
});
|
||||
return done.promise;
|
||||
};
|
||||
let handleCoverageData = function (configArg) {
|
||||
let done = q.defer();
|
||||
if (71 >= configArg.coverageTreshold) {
|
||||
plugins.beautylog.ok(`${(71).toString()}% `
|
||||
let handleCoverageData = (configArg) => __awaiter(this, void 0, void 0, function* () {
|
||||
let coverageResult = yield plugins.smartcov.get.percentageFromLcovString(configArg.runData.coverageLcovInfo, 2);
|
||||
if (coverageResult >= configArg.coverageTreshold) {
|
||||
plugins.beautylog.ok(`${(coverageResult).toString()}% `
|
||||
+ `coverage exceeds your treshold of `
|
||||
+ `${configArg.coverageTreshold.toString()}%`);
|
||||
}
|
||||
else {
|
||||
plugins.beautylog.warn(`${(71).toString()}% `
|
||||
plugins.beautylog.warn(`${(coverageResult).toString()}% `
|
||||
+ `coverage fails your treshold of `
|
||||
+ `${configArg.coverageTreshold.toString()}%`);
|
||||
plugins.beautylog.error('exiting due to coverage failure');
|
||||
@ -92,9 +92,8 @@ let handleCoverageData = function (configArg) {
|
||||
process.exit(1);
|
||||
}
|
||||
}
|
||||
done.resolve(configArg);
|
||||
return done.promise;
|
||||
};
|
||||
return configArg;
|
||||
});
|
||||
exports.run = function (configArg) {
|
||||
let done = q.defer();
|
||||
let config = configArg;
|
||||
|
3
dist/mod02/mod02.plugins.d.ts
vendored
3
dist/mod02/mod02.plugins.d.ts
vendored
@ -3,5 +3,6 @@ import * as gulp from 'gulp';
|
||||
import * as gulpFunction from 'gulp-function';
|
||||
import * as gulpSourcemaps from 'gulp-sourcemaps';
|
||||
import * as gulpTypeScript from 'gulp-typescript';
|
||||
import * as smartcov from 'smartcov';
|
||||
import * as tapbuffer from 'tapbuffer';
|
||||
export { gulp, gulpFunction, gulpSourcemaps, gulpTypeScript, tapbuffer };
|
||||
export { gulp, gulpFunction, gulpSourcemaps, gulpTypeScript, smartcov, tapbuffer };
|
||||
|
2
dist/mod02/mod02.plugins.js
vendored
2
dist/mod02/mod02.plugins.js
vendored
@ -12,5 +12,7 @@ const gulpSourcemaps = require("gulp-sourcemaps");
|
||||
exports.gulpSourcemaps = gulpSourcemaps;
|
||||
const gulpTypeScript = require("gulp-typescript");
|
||||
exports.gulpTypeScript = gulpTypeScript;
|
||||
const smartcov = require("smartcov");
|
||||
exports.smartcov = smartcov;
|
||||
const tapbuffer = require("tapbuffer");
|
||||
exports.tapbuffer = tapbuffer;
|
||||
|
Reference in New Issue
Block a user