fix: --watch for testing
This commit is contained in:
parent
8423867474
commit
d4fd51b26d
|
@ -171,13 +171,18 @@ program
|
|||
|
||||
const test = async () => {
|
||||
process.argv.splice(2, 1);
|
||||
const watchIndex = process.argv.indexOf('--watch');
|
||||
if (-1 !== watchIndex) {
|
||||
process.argv.splice(watchIndex, 1);
|
||||
}
|
||||
await build(['--display', 'none']);
|
||||
spawn(
|
||||
'mocha',
|
||||
[
|
||||
(-1 === watchIndex ? [] : ['--watch'])
|
||||
.concat([
|
||||
'--colors',
|
||||
'test.js',
|
||||
],
|
||||
]),
|
||||
{
|
||||
env: {
|
||||
NODE_PATH: './node_modules',
|
||||
|
@ -190,6 +195,7 @@ const test = async () => {
|
|||
|
||||
program
|
||||
.command('test')
|
||||
.allowUnknownOption()
|
||||
.description('build and run tests')
|
||||
.action(test);
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user