+8
-3
@@ -34,8 +34,8 @@ const checkCoverage = flagArgs.indexOf('--coverage') >= 0;
|
|||||||
|
|
||||||
if (checkCoverage) {
|
if (checkCoverage) {
|
||||||
flagArgs.splice(flagArgs.indexOf('--coverage'), 1);
|
flagArgs.splice(flagArgs.indexOf('--coverage'), 1);
|
||||||
const executable = path.resolve(__dirname, '../node_modules/.bin/nyc');
|
const executable = npmBinScript('nyc');
|
||||||
const args = ['--check-coverage', `--lines=${COVERAGE_LINES_THRESHOLD}`, path.resolve(__dirname, '../node_modules/.bin/mocha'), ...testFiles, ...flagArgs];
|
const args = ['--check-coverage', `--lines=${COVERAGE_LINES_THRESHOLD}`, npmBinScript('mocha'), ...testFiles, ...flagArgs];
|
||||||
console.info('executable', executable);
|
console.info('executable', executable);
|
||||||
console.info('args', args);
|
console.info('args', args);
|
||||||
const run = cp.spawnSync(
|
const run = cp.spawnSync(
|
||||||
@@ -51,7 +51,7 @@ if (checkCoverage) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const run = cp.spawnSync(
|
const run = cp.spawnSync(
|
||||||
path.resolve(__dirname, '../node_modules/.bin/mocha'),
|
npmBinScript('mocha'),
|
||||||
[...testFiles, ...flagArgs],
|
[...testFiles, ...flagArgs],
|
||||||
{
|
{
|
||||||
cwd: path.resolve(__dirname, '..'),
|
cwd: path.resolve(__dirname, '..'),
|
||||||
@@ -59,4 +59,9 @@ const run = cp.spawnSync(
|
|||||||
stdio: 'inherit'
|
stdio: 'inherit'
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
function npmBinScript(script) {
|
||||||
|
return path.resolve(__dirname, `../node_modules/.bin/` + (process.platform === 'win32' ? `${script}.cmd` : script));
|
||||||
|
}
|
||||||
|
|
||||||
process.exit(run.status);
|
process.exit(run.status);
|
||||||
|
|||||||
Reference in New Issue
Block a user