Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: improve custom puppeteer example to prevent worker warnings #13619

Merged
merged 1 commit into from Jan 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Expand Up @@ -7,6 +7,7 @@
### Chore & Maintenance

- `[@jest/fake-timers]` Update `@sinonjs/fake-timers` ([#13612](https://github.com/facebook/jest/pull/13612))
- `[docs]` Improve custom puppeteer example to prevent worker warnings ([#13619](https://github.com/facebook/jest/pull/13619))

### Performance

Expand Down
3 changes: 3 additions & 0 deletions docs/Puppeteer.md
Expand Up @@ -108,6 +108,9 @@ class PuppeteerEnvironment extends NodeEnvironment {
}

async teardown() {
if (this.global.__BROWSER_GLOBAL__) {
this.global.__BROWSER_GLOBAL__.disconnect();
}
await super.teardown();
}

Expand Down
3 changes: 3 additions & 0 deletions website/versioned_docs/version-25.x/Puppeteer.md
Expand Up @@ -108,6 +108,9 @@ class PuppeteerEnvironment extends NodeEnvironment {
}

async teardown() {
if (this.global.__BROWSER_GLOBAL__) {
this.global.__BROWSER_GLOBAL__.disconnect();
}
await super.teardown();
}

Expand Down
3 changes: 3 additions & 0 deletions website/versioned_docs/version-26.x/Puppeteer.md
Expand Up @@ -108,6 +108,9 @@ class PuppeteerEnvironment extends NodeEnvironment {
}

async teardown() {
if (this.global.__BROWSER_GLOBAL__) {
this.global.__BROWSER_GLOBAL__.disconnect();
}
await super.teardown();
}

Expand Down
3 changes: 3 additions & 0 deletions website/versioned_docs/version-27.x/Puppeteer.md
Expand Up @@ -108,6 +108,9 @@ class PuppeteerEnvironment extends NodeEnvironment {
}

async teardown() {
if (this.global.__BROWSER_GLOBAL__) {
this.global.__BROWSER_GLOBAL__.disconnect();
}
await super.teardown();
}

Expand Down
3 changes: 3 additions & 0 deletions website/versioned_docs/version-28.x/Puppeteer.md
Expand Up @@ -108,6 +108,9 @@ class PuppeteerEnvironment extends NodeEnvironment {
}

async teardown() {
if (this.global.__BROWSER_GLOBAL__) {
this.global.__BROWSER_GLOBAL__.disconnect();
}
await super.teardown();
}

Expand Down
3 changes: 3 additions & 0 deletions website/versioned_docs/version-29.0/Puppeteer.md
Expand Up @@ -108,6 +108,9 @@ class PuppeteerEnvironment extends NodeEnvironment {
}

async teardown() {
if (this.global.__BROWSER_GLOBAL__) {
this.global.__BROWSER_GLOBAL__.disconnect();
}
await super.teardown();
}

Expand Down
3 changes: 3 additions & 0 deletions website/versioned_docs/version-29.1/Puppeteer.md
Expand Up @@ -108,6 +108,9 @@ class PuppeteerEnvironment extends NodeEnvironment {
}

async teardown() {
if (this.global.__BROWSER_GLOBAL__) {
this.global.__BROWSER_GLOBAL__.disconnect();
}
await super.teardown();
}

Expand Down
3 changes: 3 additions & 0 deletions website/versioned_docs/version-29.2/Puppeteer.md
Expand Up @@ -108,6 +108,9 @@ class PuppeteerEnvironment extends NodeEnvironment {
}

async teardown() {
if (this.global.__BROWSER_GLOBAL__) {
this.global.__BROWSER_GLOBAL__.disconnect();
}
await super.teardown();
}

Expand Down
3 changes: 3 additions & 0 deletions website/versioned_docs/version-29.3/Puppeteer.md
Expand Up @@ -108,6 +108,9 @@ class PuppeteerEnvironment extends NodeEnvironment {
}

async teardown() {
if (this.global.__BROWSER_GLOBAL__) {
this.global.__BROWSER_GLOBAL__.disconnect();
}
await super.teardown();
}

Expand Down