Catch top-level errors thrown in electron tests
Co-authored-by: yash-signal <yash@signal.org>
This commit is contained in:
parent
106a3bfc9b
commit
0a6a6d65ed
1 changed files with 10 additions and 2 deletions
|
@ -150,8 +150,16 @@ window.testUtilities = {
|
|||
|
||||
for (let i = 0; i < files.length; i += 1) {
|
||||
if (i % workerCount === worker) {
|
||||
// eslint-disable-next-line import/no-dynamic-require, global-require
|
||||
require(files[i]);
|
||||
try {
|
||||
// eslint-disable-next-line import/no-dynamic-require, global-require
|
||||
require(files[i]);
|
||||
} catch (error) {
|
||||
window.testUtilities.onTestEvent({
|
||||
type: 'fail',
|
||||
title: ['Failed to load test:', files[i]],
|
||||
error: error.stack || String(error),
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue