refactor: exit on events instead of on timeout for dialog crash test

Co-authored-by: Robo <hop2deep@gmail.com>
This commit is contained in:
Noah Gregory
2026-03-06 20:08:41 -05:00
parent e4e7d57b92
commit 884cebe2ae

View File

@@ -1,9 +1,22 @@
const { app, BrowserWindow } = require('electron');
process.on('uncaughtException', (err) => {
console.error(err);
process.exit(1);
});
process.on('unhandledRejection', (reason) => {
console.error(reason);
process.exit(1);
});
app.on('browser-window-created', (ev, window) => {
window.webContents.once('did-frame-navigate', (ev, url) => {
process.exit(0);
});
});
app.whenReady().then(() => {
const win = new BrowserWindow({ show: false });
win.loadFile('index.html');
setTimeout(() => {
process.exit(0);
}, 1000);
});