Skip to content

Commit

Permalink
fix: use browser.disconnect method
Browse files Browse the repository at this point in the history
Use the `.disconnect` method when connecting to long-running or external chromium.  As documented here:
 
https://pptr.dev/#?product=Puppeteer&version=v1.11.0&show=api-browserdisconnect
  • Loading branch information
donovan-graham authored and gregberge committed Dec 6, 2018
1 parent 0505b2c commit 7afbb2e
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions packages/jest-environment-puppeteer/src/global.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,12 @@ export async function setup() {
}

export async function teardown() {
const config = await readConfig()
await teardownServer()
if (!config.connect) {

const config = await readConfig()
if (config.connect) {
await browser.disconnect();
} else {
await browser.close()
}
}

0 comments on commit 7afbb2e

Please sign in to comment.