e2e-test: ignore unhandled errors from jsdom

This commit is contained in:
Patrik Oldsberg
2020-09-17 19:17:31 +02:00
parent 3cdbf5e0b5
commit 51a9b70e3a
+11 -1
View File
@@ -403,5 +403,15 @@ async function testBackendStart(appDir: string, isPostgres: boolean) {
}
}
process.on('unhandledRejection', handleError);
process.on('unhandledRejection', (error: Error) => {
// Try to avoid exiting if the unhandled error is coming from jsdom, i.e. zombie.
// Those are typically errors on the page that should be benign, at least in the
// context of this test. We have other ways of asserting that the page is being
// rendered correctly.
if (error?.stack?.includes('node_modules/jsdom/lib')) {
console.log(`Ignored error inside jsdom, ${error}`);
} else {
handleError(error);
}
});
main().catch(handleError);