jest-environment-jsdom 27.3.1 → 27.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/index.js +6 -2
- package/package.json +13 -10
package/build/index.js
CHANGED
|
@@ -163,12 +163,16 @@ class JSDOMEnvironment {
|
|
|
163
163
|
if (this.global) {
|
|
164
164
|
if (this.errorEventListener) {
|
|
165
165
|
this.global.removeEventListener('error', this.errorEventListener);
|
|
166
|
-
}
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
this.global.close(); // Dispose "document" to prevent "load" event from triggering.
|
|
169
|
+
// Note that this.global.close() will trigger the CustomElement::disconnectedCallback
|
|
170
|
+
// Do not reset the document before CustomElement disconnectedCallback function has finished running,
|
|
171
|
+
// document should be accessible within disconnectedCallback.
|
|
167
172
|
|
|
168
173
|
Object.defineProperty(this.global, 'document', {
|
|
169
174
|
value: null
|
|
170
175
|
});
|
|
171
|
-
this.global.close();
|
|
172
176
|
}
|
|
173
177
|
|
|
174
178
|
this.errorEventListener = null; // @ts-expect-error
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "jest-environment-jsdom",
|
|
3
|
-
"version": "27.
|
|
3
|
+
"version": "27.4.0",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "https://github.com/facebook/jest.git",
|
|
@@ -10,21 +10,24 @@
|
|
|
10
10
|
"main": "./build/index.js",
|
|
11
11
|
"types": "./build/index.d.ts",
|
|
12
12
|
"exports": {
|
|
13
|
-
".":
|
|
13
|
+
".": {
|
|
14
|
+
"types": "./build/index.d.ts",
|
|
15
|
+
"default": "./build/index.js"
|
|
16
|
+
},
|
|
14
17
|
"./package.json": "./package.json"
|
|
15
18
|
},
|
|
16
19
|
"dependencies": {
|
|
17
|
-
"@jest/environment": "^27.
|
|
18
|
-
"@jest/fake-timers": "^27.
|
|
19
|
-
"@jest/types": "^27.
|
|
20
|
+
"@jest/environment": "^27.4.0",
|
|
21
|
+
"@jest/fake-timers": "^27.4.0",
|
|
22
|
+
"@jest/types": "^27.4.0",
|
|
23
|
+
"@types/jsdom": "^16.2.4",
|
|
20
24
|
"@types/node": "*",
|
|
21
|
-
"jest-mock": "^27.
|
|
22
|
-
"jest-util": "^27.
|
|
25
|
+
"jest-mock": "^27.4.0",
|
|
26
|
+
"jest-util": "^27.4.0",
|
|
23
27
|
"jsdom": "^16.6.0"
|
|
24
28
|
},
|
|
25
29
|
"devDependencies": {
|
|
26
|
-
"@jest/test-utils": "^27.
|
|
27
|
-
"@types/jsdom": "^16.2.4"
|
|
30
|
+
"@jest/test-utils": "^27.4.0"
|
|
28
31
|
},
|
|
29
32
|
"engines": {
|
|
30
33
|
"node": "^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0"
|
|
@@ -32,5 +35,5 @@
|
|
|
32
35
|
"publishConfig": {
|
|
33
36
|
"access": "public"
|
|
34
37
|
},
|
|
35
|
-
"gitHead": "
|
|
38
|
+
"gitHead": "0dc6dde296550370ade2574d6665748fed37f9c9"
|
|
36
39
|
}
|