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

Unable to use enableRemoteModule in #71

Open thamara opened 4 years ago

thamara commented 4 years ago

Electron 10 has a breaking change that is that enableRemoteModule now defaults to false. Although migrating out of the use of the remote module is the best (and suggested) practiced, electron apps might still rely on the remove module and because jest-electron-runner has no option to force enableRemoteModule, running tests with electron 10 becomes impossible.

I have changed locally jest-electron-runner to use force enableRemoteModule and my tests started to work as expected. So my suggestion would be to make a configuration for enabling it, but I'm not sure how to do, or if it should indeed be done. I'm willing to take this issue, but I would like to hear from you on the best way of doing this.

To be honest, I'm not sure if there are other options (besides not using remote module), that would allow me to upgrade my app to electron 10, and still be able to run my tests with jest-electron-runner. So, f you have any inputs on this, I would be very grateful. :)

aguynamedben commented 3 years ago

Any details on the upgrade path people are finding helpful here would be appreciated.

We need to upgrade to Electron 11 due to this Electron bug that causes autoUpdater.quitAndInstall() to fail to relaunch on macOS Big Sur: https://github.com/electron/electron/issues/25626.

With Electron 11, we've turned on the enableRemoteModule flag for our app until we can remove all usage, and our app runs fine on Electron 11, but tests fail because the flag is not flipped when tests are run.