eng: fix waitServer not working in unit test debug (#201334)

Fixes #182341
This commit is contained in:
Connor Peet 2023-12-20 14:09:46 -08:00 committed by GitHub
parent 651391e5ad
commit b964ed995a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -33,7 +33,7 @@ const minimist = require('minimist');
* dev: boolean;
* reporter: string;
* 'reporter-options': string;
* 'wait-server': string;
* 'waitServer': string;
* timeout: string;
* 'crash-reporter-directory': string;
* tfs: string;
@ -43,7 +43,7 @@ const minimist = require('minimist');
* }}
*/
const args = minimist(process.argv.slice(2), {
string: ['grep', 'run', 'runGlob', 'reporter', 'reporter-options', 'wait-server', 'timeout', 'crash-reporter-directory', 'tfs'],
string: ['grep', 'run', 'runGlob', 'reporter', 'reporter-options', 'waitServer', 'timeout', 'crash-reporter-directory', 'tfs'],
boolean: ['build', 'coverage', 'help', 'dev'],
alias: {
'grep': ['g', 'f'],
@ -69,7 +69,7 @@ Options:
--dev, --dev-tools, --devTools <window> open dev tools, keep window open, reuse app data
--reporter <reporter> the mocha reporter (default: "spec")
--reporter-options <options> the mocha reporter options (default: "")
--wait-server <port> port to connect to and wait before running tests
--waitServer <port> port to connect to and wait before running tests
--timeout <ms> timeout for tests
--crash-reporter-directory <path> crash reporter directory
--tfs <url> TFS server URL
@ -232,8 +232,8 @@ app.on('ready', () => {
win.webContents.openDevTools();
}
if (args['wait-server']) {
waitForServer(Number(args['wait-server'])).then(sendRun);
if (args.waitServer) {
waitForServer(Number(args.waitServer)).then(sendRun);
} else {
sendRun();
}