From 9f15f2682827a560870e7997dc07023e592dd79f Mon Sep 17 00:00:00 2001 From: Fedor Indutny <79877362+indutny-signal@users.noreply.github.com> Date: Sat, 18 Dec 2021 00:12:42 +0100 Subject: [PATCH] Support running test-electron manually --- app/main.ts | 4 ++++ ts/build/test-electron.ts | 1 + 2 files changed, 5 insertions(+) diff --git a/app/main.ts b/app/main.ts index be2a175b2..85d4c733b 100644 --- a/app/main.ts +++ b/app/main.ts @@ -2138,6 +2138,10 @@ ipc.handle('getScreenCaptureSources', async () => { if (isTestEnvironment(getEnvironment())) { ipc.handle('ci:test-electron:done', async (_event, info) => { + if (!process.env.TEST_QUIT_ON_COMPLETE) { + return; + } + process.stdout.write( `ci:test-electron:done=${JSON.stringify(info)}\n`, () => app.quit() diff --git a/ts/build/test-electron.ts b/ts/build/test-electron.ts index 7ca82fbfe..cfadc5af5 100644 --- a/ts/build/test-electron.ts +++ b/ts/build/test-electron.ts @@ -19,6 +19,7 @@ const stdout = execFileSync(ELECTRON, [ROOT_DIR], { env: { ...process.env, NODE_ENV: 'test', + TEST_QUIT_ON_COMPLETE: 'on', }, encoding: 'utf8', });