fix #17, now computing coverage result correctly
This commit is contained in:
2
dist/mod00/mod00.assets.js
vendored
2
dist/mod00/mod00.assets.js
vendored
@ -7,7 +7,7 @@ const mod00_check_1 = require("../mod00/mod00.check");
|
||||
exports.run = function (configArg) {
|
||||
let done = q.defer();
|
||||
let config = configArg;
|
||||
plugins.beautylog.ora.text('now looking at ' + 'required assets'.yellow);
|
||||
plugins.beautylog.ora.text('now looking at ' + 'required assets');
|
||||
if (config.cli === true) {
|
||||
let mainJsPath = mod00_check_1.projectInfo.packageJson.main;
|
||||
let cliJsString = plugins.smartfile.fs.toStringSync(plugins.path.join(paths.npmtsAssetsDir, 'cli.js'));
|
||||
|
12
dist/mod00/mod00.check.js
vendored
12
dist/mod00/mod00.check.js
vendored
@ -56,11 +56,11 @@ let checkDependencies = (configArg) => {
|
||||
process.exit(1);
|
||||
}
|
||||
for (let item in unused.invalidFiles) {
|
||||
plugins.beautylog.warn(`Watch out: could not parse file ${item.red}`);
|
||||
plugins.beautylog.warn(`Watch out: could not parse file ${item}`);
|
||||
}
|
||||
;
|
||||
for (let item in unused.invalidDirs) {
|
||||
plugins.beautylog.warn(`Watch out: could not parse directory ${item.red}`);
|
||||
plugins.beautylog.warn(`Watch out: could not parse directory ${item}`);
|
||||
}
|
||||
done.resolve(configArg);
|
||||
});
|
||||
@ -82,20 +82,20 @@ let checkDevDependencies = (configArg) => {
|
||||
});
|
||||
plugins.depcheck(paths.cwd, depcheckOptionsMerged, (unused) => {
|
||||
for (let item of unused.devDependencies) {
|
||||
plugins.beautylog.log(`unused devDependency ${item.red}`);
|
||||
plugins.beautylog.log(`unused devDependency ${item}`);
|
||||
}
|
||||
for (let item in unused.missing) {
|
||||
plugins.beautylog.error(`unused devDependency ${item.red}`);
|
||||
plugins.beautylog.error(`unused devDependency ${item}`);
|
||||
}
|
||||
if (unused.missing.length > 0) {
|
||||
plugins.beautylog.info('exiting due to missing dependencies in package.json');
|
||||
process.exit(1);
|
||||
}
|
||||
for (let item in unused.invalidFiles) {
|
||||
plugins.beautylog.warn(`Watch out: could not parse file ${item.red}`);
|
||||
plugins.beautylog.warn(`Watch out: could not parse file ${item}`);
|
||||
}
|
||||
for (let item in unused.invalidDirs) {
|
||||
plugins.beautylog.warn(`Watch out: could not parse directory ${item.red}`);
|
||||
plugins.beautylog.warn(`Watch out: could not parse directory ${item}`);
|
||||
}
|
||||
done.resolve(configArg);
|
||||
});
|
||||
|
2
dist/mod00/mod00.compile.js
vendored
2
dist/mod00/mod00.compile.js
vendored
@ -6,7 +6,7 @@ const plugins = require("./mod00.plugins");
|
||||
exports.run = function (configArg) {
|
||||
let done = q.defer();
|
||||
let config = configArg;
|
||||
plugins.beautylog.ora.text('now compiling ' + 'TypeScript'.yellow);
|
||||
plugins.beautylog.ora.text('now compiling ' + 'TypeScript');
|
||||
plugins.tsn.compileGlobStringObject(config.ts, config.tsOptions, paths.cwd)
|
||||
.then(() => {
|
||||
plugins.beautylog.ok(`compiled the module's TypeScript!`);
|
||||
|
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;
|
||||
|
4
dist/npmts.config.d.ts
vendored
4
dist/npmts.config.d.ts
vendored
@ -8,5 +8,9 @@ export interface INpmtsConfig {
|
||||
ts: any;
|
||||
tsOptions: any;
|
||||
watch: boolean;
|
||||
runData: {
|
||||
coverageLcovInfo?: string;
|
||||
coverageResult?: number;
|
||||
};
|
||||
}
|
||||
export declare let run: (argvArg: any) => Promise<{}>;
|
||||
|
3
dist/npmts.config.js
vendored
3
dist/npmts.config.js
vendored
@ -14,7 +14,8 @@ exports.run = function (argvArg) {
|
||||
testTs: {},
|
||||
ts: {},
|
||||
tsOptions: {},
|
||||
watch: false
|
||||
watch: false,
|
||||
runData: {}
|
||||
};
|
||||
// mix with configfile
|
||||
plugins.beautylog.ora.text('running npmextra');
|
||||
|
Reference in New Issue
Block a user