1
0
Fork 0
mirror of https://github.com/kou029w/_.git synced 2025-01-31 06:18:07 +00:00

Unhandled promise rejection terminates Node.js process with non-zero exit code.

This commit is contained in:
Nebel 2020-07-27 20:06:30 +09:00
parent a33afbef1b
commit 679f725e02

View file

@ -1,6 +1,11 @@
const playwright = require("playwright"); const playwright = require("playwright");
async function main() { async function main() {
// NOTE: Unhandled promise rejection terminates Node.js process with non-zero exit code.
process.on("unhandledRejection", (event) => {
throw event;
});
for (const browserType of ["chromium", "firefox", "webkit"]) { for (const browserType of ["chromium", "firefox", "webkit"]) {
const browser = await playwright[browserType].launch(); const browser = await playwright[browserType].launch();
const context = await browser.newContext(); const context = await browser.newContext();