Merge coverage check into regular unit test check

Fixes #2542
This commit is contained in:
Daniel Imms
2019-11-06 11:04:37 -08:00
parent d4dbdac73f
commit d079775690
3 changed files with 24 additions and 15 deletions
+20 -1
View File
@@ -28,6 +28,26 @@ if (process.argv.length > 2) {
}
}
const checkCoverage = flagArgs.indexOf('--coverage') >= 0;
if (checkCoverage) {
flagArgs.splice(flagArgs.indexOf('--coverage'), 1);
const executable = path.resolve(__dirname, '../node_modules/.bin/nyc');
const args = ['--check-coverage', '--lines=100', path.resolve(__dirname, '../node_modules/.bin/mocha'), ...testFiles, ...flagArgs];
console.info('executable', executable);
console.info('args', args);
const run = cp.spawnSync(
executable,
args,
{
cwd: path.resolve(__dirname, '..'),
env,
stdio: 'inherit'
}
);
process.exit(run.status);
}
const run = cp.spawnSync(
path.resolve(__dirname, '../node_modules/.bin/mocha'),
[...testFiles, ...flagArgs],
@@ -37,5 +57,4 @@ const run = cp.spawnSync(
stdio: 'inherit'
}
);
process.exit(run.status);