add coverage option

This commit is contained in:
2017-06-16 16:08:36 +02:00
parent 2bd187b704
commit 455c89d68d
5 changed files with 33 additions and 18 deletions

18
dist/mod02/index.js vendored
View File

@ -109,11 +109,19 @@ exports.run = function (configArg) {
plugins.beautylog.ora.text('now starting tests');
plugins.beautylog.ora.end();
plugins.beautylog.log('ready for tapbuffer:');
tap(config)
.then(handleCoverageData)
.then(() => {
done.resolve(config);
}).catch(err => { console.log(err); });
if (configArg.coverage) {
tap(config)
.then(handleCoverageData)
.then(() => {
done.resolve(config);
}).catch(err => { console.log(err); });
}
else {
tap(config)
.then(() => {
done.resolve(config);
}).catch(err => { console.log(err); });
}
}
else {
plugins.beautylog.ora.end();

View File

@ -7,6 +7,7 @@
export declare type npmtsMode = 'default' | 'custom' | 'merge';
export interface INpmtsConfig {
argv: any;
coverage: boolean;
coverageTreshold: number;
checkDependencies: boolean;
mode: npmtsMode;

View File

@ -7,6 +7,7 @@ exports.run = function (argvArg) {
let done = q.defer();
let defaultConfig = {
argv: undefined,
coverage: true,
coverageTreshold: 70,
checkDependencies: true,
mode: 'default',
@ -35,7 +36,6 @@ exports.run = function (argvArg) {
plugins.beautylog.error(`mode not recognised! Can be default or custom`);
process.exit(1);
}
;
// handle default mode
if (config.mode === 'default' || config.mode === 'merge') {
config.ts = {
@ -45,16 +45,13 @@ exports.run = function (argvArg) {
'./test/**/*.ts': './test/'
};
}
;
// mix with commandline
if (config.argv.notest) {
config.test = false;
}
;
if (config.argv.watch) {
config.watch = true;
}
;
plugins.beautylog.ok('build options are ready!');
done.resolve(config);
return done.promise;