Merge pull request #2505 from spotify/rugvip/nodoom

e2e-test: ignore unhandled errors from jsdom
This commit is contained in:
Patrik Oldsberg
2020-09-18 09:47:32 +02:00
committed by GitHub
+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);