Skip to content

Commit

Permalink
fix: fix toDisplayDialog
Browse files Browse the repository at this point in the history
  • Loading branch information
gregberge committed Dec 18, 2019
1 parent e1537bb commit ce9df04
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/expect-puppeteer/src/matchers/toDisplayDialog.js
Original file line number Diff line number Diff line change
@@ -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)
})
}

Expand Down

0 comments on commit ce9df04

Please sign in to comment.