mirror of
https://github.com/wavetermdev/xterm.js.git
synced 2026-08-05 13:43:48 -07:00
Update test-unit to allow double dash args
This commit is contained in:
+12
-5
@@ -15,15 +15,22 @@ let testFiles = [
|
||||
'./out/**/*test.js'
|
||||
];
|
||||
|
||||
// ability to inject particular test files via
|
||||
// yarn test [testFileA testFileB ...]
|
||||
let flagArgs = [];
|
||||
|
||||
if (process.argv.length > 2) {
|
||||
testFiles = process.argv.slice(2);
|
||||
const args = process.argv.slice(2);
|
||||
flagArgs = args.filter(e => e.startsWith('--'));
|
||||
// ability to inject particular test files via
|
||||
// yarn test [testFileA testFileB ...]
|
||||
files = args.filter(e => !e.startsWith('--'));
|
||||
if(files.length){
|
||||
testFiles = files;
|
||||
}
|
||||
}
|
||||
|
||||
const run = cp.spawnSync(
|
||||
path.resolve(__dirname, '../node_modules/.bin/mocha'),
|
||||
testFiles,
|
||||
[...testFiles, ...flagArgs],
|
||||
{
|
||||
cwd: path.resolve(__dirname, '..'),
|
||||
env,
|
||||
@@ -31,4 +38,4 @@ const run = cp.spawnSync(
|
||||
}
|
||||
);
|
||||
|
||||
process.exit(run.status);
|
||||
process.exit(run.status);
|
||||
|
||||
Reference in New Issue
Block a user