SDA-1877 - Fix Spectron tests

This commit is contained in:
Kiran Niranjan 2020-03-23 17:45:21 +05:30
parent bec095d576
commit 59986f0818
2 changed files with 5 additions and 3 deletions

View File

@ -32,7 +32,7 @@
"start": "run-s compile browserify && cross-env ELECTRON_DEV=true electron .",
"test": "run-s lint test:unit",
"test:unit": "cross-env ELECTRON_QA=true jest --config jest-config.json --runInBand --detectOpenHandles",
"test:spectron": "npm run copy && run-s lint compile browserify && npx ava --verbose --serial",
"test:spectron": "npm run copy && run-s lint compile browserify && cross-env ELECTRON_QA=true npx ava --verbose --serial",
"copy": "run-os",
"copy:darwin": "ncp config 'node_modules/electron/dist/Electron.app/Contents/config'",
"copy:win32": "ncp config node_modules\\electron\\dist\\config",

View File

@ -2,7 +2,7 @@ import { app } from 'electron';
import * as electronDownloader from 'electron-dl';
import * as shellPath from 'shell-path';
import { isDevEnv, isLinux, isMac } from '../common/env';
import { isDevEnv, isElectronQA, isLinux, isMac } from '../common/env';
import { logger } from '../common/logger';
import { getCommandLineArgs } from '../common/utils';
import { cleanUpAppCache, createAppCacheFile } from './app-cache-handler';
@ -51,7 +51,9 @@ setChromeFlags();
// Need this to prevent blank pop-out from 8.x versions
// Refer - SDA-1877 - https://github.com/electron/electron/issues/18397
app.allowRendererProcessReuse = true;
if (!isElectronQA) {
app.allowRendererProcessReuse = true;
}
// Electron sets the default protocol
if (!isDevEnv) {