redux-devtools/extension/test/electron/fixture/main.js
Nathan Bierema a304a2c1a8
chore(extension): upgrade Electron for tests (#718)
* mode: 'detach'

* Upgrade selenium-webdriver

* Temporarily use electron-chromedriver

* electron@3

* electron@5

* electron@8

* electron@11

* electron@12

* electron@13

* stash

* This works

* Cleanup

* Prettify
2021-06-06 15:04:43 -04:00

22 lines
571 B
JavaScript

const path = require('path');
const { app, BrowserWindow, session } = require('electron');
app.on('window-all-closed', app.quit);
app.whenReady().then(async () => {
await session.defaultSession.loadExtension(
path.join(__dirname, '../../../build/extension'),
{ allowFileAccess: true }
);
const mainWindow = new BrowserWindow({
width: 150,
height: 100,
webPreferences: {
nodeIntegration: true,
contextIsolation: false,
},
});
mainWindow.loadFile('index.html');
mainWindow.webContents.openDevTools({ mode: 'detach' });
});