better error handling in case of loader error in tests
This commit is contained in:
parent
59e50ff799
commit
18dfdcbf52
2 changed files with 15 additions and 1 deletions
|
@ -100,6 +100,13 @@ function parseReporterOption(value) {
|
|||
|
||||
app.on('ready', () => {
|
||||
|
||||
ipcMain.on('error', (_, err) => {
|
||||
if (!argv.debug) {
|
||||
console.error(err);
|
||||
app.exit(1);
|
||||
}
|
||||
});
|
||||
|
||||
const win = new BrowserWindow({
|
||||
height: 600,
|
||||
width: 800,
|
||||
|
|
|
@ -273,5 +273,12 @@ function runTests(opts) {
|
|||
|
||||
ipcRenderer.on('run', (e, opts) => {
|
||||
initLoader(opts);
|
||||
runTests(opts).catch(err => console.error(typeof err === 'string' ? err : JSON.stringify(err)));
|
||||
runTests(opts).catch(err => {
|
||||
if (!(typeof err !== 'string')) {
|
||||
err = JSON.stringify(err);
|
||||
}
|
||||
|
||||
console.error(err);
|
||||
ipcRenderer.send('error', err);
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue