facebook-atom / jest-electron-runner

custom test runner for Jest that allows tests to be run in Electron environment
MIT License
189 stars 33 forks source link

app.allowRendererProcessReuse is deprecated #56

Open unional opened 4 years ago

unional commented 4 years ago

When running electron tests, it prints out the following warning:

(electron) The default value of app.allowRendererProcessReuse is deprecated, it is currently "false". It will change to be "true" in Electron 9. For more information please check https://github.com/electron/electron/issues/18397

dschuessler commented 4 years ago

This also breaks the layout of the test result reporting considerably.

rajivshah3 commented 3 years ago

This can be silenced by using patch-package to add these lines:

In @jest-runner/electron/src/electron_process_injected_code.js:

app.commandLine.appendSwitch('high-dpi-support', 1);
app.commandLine.appendSwitch('force-device-scale-factor', 1);
+ app.allowRendererProcessReuse = false;
app.on('ready', async () => {

In @jest-runner/electron/build/electron_process_injected_code.js:

_electron.app.commandLine.appendSwitch('high-dpi-support', 1);
_electron.app.commandLine.appendSwitch('force-device-scale-factor', 1);
+ _electron.app.allowRendererProcessReuse = false;
_electron.app.on('ready', async () => {