Skip to content

Commit

Permalink
feat: upgrade to JSDOM@21
Browse files Browse the repository at this point in the history
  • Loading branch information
SimenB committed Jan 26, 2023
1 parent 8884105 commit 13b845d
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 13 deletions.
2 changes: 1 addition & 1 deletion packages/jest-environment-jsdom/package.json
Expand Up @@ -24,7 +24,7 @@
"@types/node": "*",
"jest-mock": "workspace:^",
"jest-util": "workspace:^",
"jsdom": "^20.0.0"
"jsdom": "^21.1.0"
},
"devDependencies": {
"@jest/test-utils": "workspace:^"
Expand Down
7 changes: 0 additions & 7 deletions packages/jest-environment-jsdom/src/index.ts
Expand Up @@ -160,13 +160,6 @@ export default class JSDOMEnvironment implements JestEnvironment<number> {
this.global.removeEventListener('error', this.errorEventListener);
}
this.global.close();

// Dispose "document" to prevent "load" event from triggering.

// Note that this.global.close() will trigger the CustomElement::disconnectedCallback
// Do not reset the document before CustomElement disconnectedCallback function has finished running,
// document should be accessible within disconnectedCallback.
Object.defineProperty(this.global, 'document', {value: null});
}
this.errorEventListener = null;
// @ts-expect-error: this.global not allowed to be `null`
Expand Down
10 changes: 5 additions & 5 deletions yarn.lock
Expand Up @@ -12705,7 +12705,7 @@ __metadata:
"@types/node": "*"
jest-mock: "workspace:^"
jest-util: "workspace:^"
jsdom: ^20.0.0
jsdom: ^21.1.0
peerDependencies:
canvas: ^2.5.0
peerDependenciesMeta:
Expand Down Expand Up @@ -13414,9 +13414,9 @@ __metadata:
languageName: node
linkType: hard

"jsdom@npm:^20.0.0":
version: 20.0.3
resolution: "jsdom@npm:20.0.3"
"jsdom@npm:^21.1.0":
version: 21.1.0
resolution: "jsdom@npm:21.1.0"
dependencies:
abab: ^2.0.6
acorn: ^8.8.1
Expand Down Expand Up @@ -13449,7 +13449,7 @@ __metadata:
peerDependenciesMeta:
canvas:
optional: true
checksum: 6e2ae21db397133a061b270c26d2dbc0b9051733ea3b896a7ece78d79f475ff0974f766a413c1198a79c793159119169f2335ddb23150348fbfdcfa6f3105536
checksum: 2c89c72a6f399184ffc8de30bbdd86283086dbd72bb3a40667102d3f12af141c7517ffb78150a3bb6883a654e8c7d0266c3328d1c387a2b9a1fd0729dc537954
languageName: node
linkType: hard

Expand Down

0 comments on commit 13b845d

Please sign in to comment.