From ce9df04642720a6af23e9b25f1b341bc82eca564 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Greg=20Berg=C3=A9?= Date: Wed, 18 Dec 2019 08:41:12 +0100 Subject: [PATCH] fix: fix toDisplayDialog --- packages/expect-puppeteer/src/matchers/toDisplayDialog.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/expect-puppeteer/src/matchers/toDisplayDialog.js b/packages/expect-puppeteer/src/matchers/toDisplayDialog.js index 23af5141..2d6c8a19 100644 --- a/packages/expect-puppeteer/src/matchers/toDisplayDialog.js +++ b/packages/expect-puppeteer/src/matchers/toDisplayDialog.js @@ -1,11 +1,11 @@ async function toDisplayDialog(page, block) { - return new Promise(async resolve => { + return new Promise((resolve, reject) => { const handleDialog = dialog => { page.removeListener('dialog', handleDialog) resolve(dialog) } page.on('dialog', handleDialog) - await block() + block().catch(reject) }) }