mirror of
https://github.com/finos/SymphonyElectron.git
synced 2024-12-27 17:31:36 -06:00
SDA-3833 (Update isDevEnv check) (#2070)
* SDA-3833 - Update isDevEnv check * SDA-3833 - Update isDevEnv for unit tests
This commit is contained in:
parent
d5647f0170
commit
b862bd5561
@ -1,7 +1,7 @@
|
|||||||
<component name="ProjectRunConfigurationManager">
|
<component name="ProjectRunConfigurationManager">
|
||||||
<configuration default="false" name="Demo (Build & Run)" type="NodeJSConfigurationType" application-parameters=". --url=file://$PROJECT_DIR$/src/demo/index.html" path-to-node="$PROJECT_DIR$/node_modules/electron/dist/Electron.app/Contents/MacOS/Electron" working-dir="$PROJECT_DIR$">
|
<configuration default="false" name="Demo (Build & Run)" type="NodeJSConfigurationType" application-parameters=". --url=file://$PROJECT_DIR$/src/demo/index.html" path-to-node="$PROJECT_DIR$/node_modules/electron/dist/Electron.app/Contents/MacOS/Electron" working-dir="$PROJECT_DIR$">
|
||||||
<envs>
|
<envs>
|
||||||
<env name="ELECTRON_DEV" value="true" />
|
<env name="ELECTRON_FORCE_IS_PACKAGED" value="true" />
|
||||||
<env name="ELECTRON_DEBUGGING" value="true" />
|
<env name="ELECTRON_DEBUGGING" value="true" />
|
||||||
</envs>
|
</envs>
|
||||||
<method v="2">
|
<method v="2">
|
||||||
|
@ -31,7 +31,7 @@
|
|||||||
"postinstall": "electron-builder install-app-deps",
|
"postinstall": "electron-builder install-app-deps",
|
||||||
"start": "run-s compile browserify && cross-env ELECTRON_DEV=true electron .",
|
"start": "run-s compile browserify && cross-env ELECTRON_DEV=true electron .",
|
||||||
"test": "run-s lint test:unit",
|
"test": "run-s lint test:unit",
|
||||||
"test:unit": "cross-env ELECTRON_QA=true jest --config jest-config.json --runInBand --detectOpenHandles",
|
"test:unit": "cross-env ELECTRON_FORCE_IS_PACKAGED=false ELECTRON_QA=true jest --config jest-config.json --runInBand --detectOpenHandles",
|
||||||
"unpacked-mac": "npm run prebuild && npm run test && ./node_modules/.bin/electron-builder build --mac",
|
"unpacked-mac": "npm run prebuild && npm run test && ./node_modules/.bin/electron-builder build --mac",
|
||||||
"unpacked-win": "npm run prebuild && npm run test && node_modules\\.bin\\electron-builder build --win --x64"
|
"unpacked-win": "npm run prebuild && npm run test && node_modules\\.bin\\electron-builder build --win --x64"
|
||||||
},
|
},
|
||||||
|
@ -7,6 +7,24 @@ jest.mock('electron-log');
|
|||||||
jest.mock('../src/app/auto-update-handler', () => {
|
jest.mock('../src/app/auto-update-handler', () => {
|
||||||
return {};
|
return {};
|
||||||
});
|
});
|
||||||
|
jest.mock('../src/common/env', () => {
|
||||||
|
return {
|
||||||
|
isWindowsOS: true,
|
||||||
|
isLinux: false,
|
||||||
|
isMac: false,
|
||||||
|
isDevEnv: true,
|
||||||
|
};
|
||||||
|
});
|
||||||
|
|
||||||
|
jest.mock('../src/common/logger', () => {
|
||||||
|
return {
|
||||||
|
logger: {
|
||||||
|
setLoggerWindow: jest.fn(),
|
||||||
|
error: jest.fn(),
|
||||||
|
info: jest.fn(),
|
||||||
|
},
|
||||||
|
};
|
||||||
|
});
|
||||||
|
|
||||||
describe('config', () => {
|
describe('config', () => {
|
||||||
const configFileName: string = 'Symphony.config';
|
const configFileName: string = 'Symphony.config';
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
export const isDevEnv = process.env.ELECTRON_DEV
|
import { app } from 'electron';
|
||||||
? process.env.ELECTRON_DEV.trim().toLowerCase() === 'true'
|
export const isDevEnv = !app?.isPackaged;
|
||||||
: false;
|
|
||||||
export const isElectronQA = !!process.env.ELECTRON_QA;
|
export const isElectronQA = !!process.env.ELECTRON_QA;
|
||||||
|
|
||||||
export const isMac = process.platform === 'darwin';
|
export const isMac = process.platform === 'darwin';
|
||||||
|
Loading…
Reference in New Issue
Block a user