Add Electron test harness with example plugin
This commit is contained in:
27
test/electron/main.js
Normal file
27
test/electron/main.js
Normal file
@@ -0,0 +1,27 @@
|
||||
const { app, BrowserWindow } = require('electron');
|
||||
const path = require('path');
|
||||
|
||||
/**
|
||||
* Creates the main application window.
|
||||
* nodeIntegration is enabled so the renderer can use require() / dynamic import()
|
||||
* directly against the local node_modules — appropriate for a local test harness.
|
||||
*/
|
||||
function createWindow() {
|
||||
const win = new BrowserWindow({
|
||||
width: 1200,
|
||||
height: 800,
|
||||
backgroundColor: '#1a1a2e',
|
||||
webPreferences: {
|
||||
nodeIntegration: true,
|
||||
contextIsolation: false,
|
||||
},
|
||||
});
|
||||
|
||||
win.loadFile(path.join(__dirname, 'index.html'));
|
||||
}
|
||||
|
||||
app.whenReady().then(createWindow);
|
||||
|
||||
app.on('window-all-closed', () => {
|
||||
if (process.platform !== 'darwin') app.quit();
|
||||
});
|
||||
Reference in New Issue
Block a user