Update args parser to allow flag values

This commit is contained in:
kumaran-14
2020-04-11 21:15:24 +05:30
parent 96cb4e9a52
commit df7ba37d57
2 changed files with 7 additions and 5 deletions
+4 -1
View File
@@ -21,7 +21,8 @@ let flagArgs = [];
if (process.argv.length > 2) {
const args = process.argv.slice(2);
flagArgs = args.filter(e => e.startsWith('--'));
flagArgs = args.filter(e => e.startsWith('--')).flatMap(arg => arg.split('='));
console.info(flagArgs);
// ability to inject particular test files via
// yarn test [testFileA testFileB ...]
files = args.filter(e => !e.startsWith('--'));
@@ -30,6 +31,8 @@ if (process.argv.length > 2) {
}
}
env.DEBUG = flagArgs.indexOf('--debug') >= 0 ? 'debug' : '';
const run = cp.spawnSync(
+3 -4
View File
@@ -14,11 +14,10 @@
"lint": "eslint -c .eslintrc.json --ext .ts src/ addons/",
"test": "npm run test-unit",
"posttest": "npm run lint",
"api-test": "node ./bin/test_api.js",
"test-api": "npm run test-api-chromium",
"test-api-chromium": "mocha \"**/*.api.js\" --browser chromium --timeout 20000",
"test-api-firefox": "mocha \"**/*.api.js\" --browser firefox --timeout 20000",
"test-api-webkit": "mocha \"**/*.api.js\" --browser webkit --timeout 20000",
"test-api-chromium": "node ./bin/test_api.js --browser=chromium --timeout=20000",
"test-api-firefox": "node ./bin/test_api.js --browser=firefox --timeout=20000",
"test-api-webkit": "node ./bin/test_api.js --browser=webkit --timeout=20000",
"pretest-api-chromium": "node ./bin/download_browser.js --browser chromium",
"pretest-api-firefox": "node ./bin/download_browser.js --browser firefox",
"pretest-api-webkit": "node ./bin/download_browser.js --browser webkit",