feat(browser): Add browser.isConnected() (#4403)

Add `browser.isConnected()` to the public api to be able to tell when the browser is connected

fixes https://github.com/smooth-code/jest-puppeteer/pull/237#issuecomment-490260041
This commit is contained in:
Tony Brix
2019-05-09 18:24:52 -05:00
committed by Andrey Lushnikov
parent 13f73b5b3a
commit 511dcf9d32
4 changed files with 31 additions and 0 deletions

View File

@@ -57,6 +57,13 @@ class Browser extends EventEmitter {
this._connection.dispose();
}
/**
* @return {boolean}
*/
isConnected() {
return !this._connection._closed;
}
/**
* @return {!BrowserContext}
*/