Skip to content

Commit cef08dc

Browse files
authored
Fix: make browser tests run entirely automatically (darkreader#6869)
1 parent 3124e21 commit cef08dc

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

tests/browser/environment.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,14 @@ class PuppeteerEnvironment extends JestNodeEnvironment {
3232
this.global.page = this.page;
3333

3434
this.assignTestGlobals();
35+
36+
// Close sentinel about:blank page created by Puppeteer but not used in tests.
37+
this.browser.pages().then((pages) => {
38+
const sentinel = pages[0];
39+
if (sentinel._target._targetInfo.url === 'about:blank') {
40+
sentinel.close();
41+
}
42+
});
3543
}
3644

3745
async launchBrowser() {

0 commit comments

Comments
 (0)