Skip to content

Commit 3f1626d

Browse files
committed
Handle puppeteer errors correctly, don't trigger UnhandledPromiseRejectionWarning
1 parent 439e79c commit 3f1626d

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

test/integrationTest.js

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,15 @@ const runTest = async (browser) => {
5252
};
5353

5454
(async () => {
55-
const browser = await puppeteer.launch({args: ['--allow-file-access-from-files']});
56-
const success = await runTest(browser);
57-
browser.close();
55+
try {
56+
const browser = await puppeteer.launch({args: ['--allow-file-access-from-files']});
57+
const success = await runTest(browser);
58+
browser.close();
5859

59-
process.exit(success ? 0 : 1);
60+
process.exit(success ? 0 : 1);
61+
} catch (e) {
62+
console.error(e);
63+
process.exit(2);
64+
}
6065
})();
6166
/* jshint ignore:end */

0 commit comments

Comments
 (0)