Skip to content

Commit

Permalink
avoid catch on disconnect (#456)
Browse files Browse the repository at this point in the history
Co-authored-by: lcapra <luca.capra@spindox.it>
  • Loading branch information
muka and lc-spxl committed Nov 25, 2021
1 parent 5af4535 commit 51b8706
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions packages/jest-environment-puppeteer/src/global.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,7 @@ export async function teardown(jestConfig = {}) {
await Promise.all(
browsers.map((browser) => {
if (config.connect) {
return browser.disconnect().catch((e) => {
console.error(`global.js teardown: Error disconnecting browser ${e.stack}`)
})
return browser.disconnect()
}
return browser.close().catch((e) => {
console.error(`global.js teardown: Error closing browser ${e.stack}`)
Expand Down

0 comments on commit 51b8706

Please sign in to comment.