Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 1 commit into from
Dec 20, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 5 additions & 5 deletions test/unit/electron/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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'],
Expand All @@ -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
Expand Down Expand Up @@ -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();
}
Expand Down