e2e-test: removed outdated unhandled rejection handler that would ignore errors

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
This commit is contained in:
Patrik Oldsberg
2024-01-17 21:27:08 +01:00
parent 63617ad9e1
commit c043396c27
-19
View File
@@ -36,23 +36,4 @@ async function main(argv: string[]) {
program.parse(argv);
}
process.on('unhandledRejection', (rejection: unknown) => {
// 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 (
rejection instanceof Error &&
rejection?.stack?.includes('node_modules/jsdom/lib')
) {
console.log(`Ignored error inside jsdom, ${rejection?.stack ?? rejection}`);
} else {
if (rejection instanceof Error) {
exitWithError(rejection);
} else {
exitWithError(new Error(`Unknown rejection: '${rejection}'`));
}
}
});
main(process.argv).catch(exitWithError);