jest-environment-jsdom 29.4.3 → 29.6.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.d.ts +1 -0
- package/build/index.js +5 -11
- package/package.json +8 -8
package/build/index.d.ts
CHANGED
|
@@ -24,6 +24,7 @@ declare class JSDOMEnvironment implements JestEnvironment<number> {
|
|
|
24
24
|
private errorEventListener;
|
|
25
25
|
moduleMocker: ModuleMocker | null;
|
|
26
26
|
customExportConditions: string[];
|
|
27
|
+
private _configuredExportConditions?;
|
|
27
28
|
constructor(config: JestEnvironmentConfig, context: EnvironmentContext);
|
|
28
29
|
setup(): Promise<void>;
|
|
29
30
|
teardown(): Promise<void>;
|
package/build/index.js
CHANGED
|
@@ -39,6 +39,8 @@ function _jestUtil() {
|
|
|
39
39
|
* LICENSE file in the root directory of this source tree.
|
|
40
40
|
*/
|
|
41
41
|
|
|
42
|
+
// The `Window` interface does not have an `Error.stackTraceLimit` property, but
|
|
43
|
+
// `JSDOMEnvironment` assumes it is there.
|
|
42
44
|
function isString(value) {
|
|
43
45
|
return typeof value === 'string';
|
|
44
46
|
}
|
|
@@ -50,6 +52,7 @@ class JSDOMEnvironment {
|
|
|
50
52
|
errorEventListener;
|
|
51
53
|
moduleMocker;
|
|
52
54
|
customExportConditions = ['browser'];
|
|
55
|
+
_configuredExportConditions;
|
|
53
56
|
constructor(config, context) {
|
|
54
57
|
const {projectConfig} = config;
|
|
55
58
|
const virtualConsole = new (_jsdom().VirtualConsole)();
|
|
@@ -124,7 +127,7 @@ class JSDOMEnvironment {
|
|
|
124
127
|
Array.isArray(customExportConditions) &&
|
|
125
128
|
customExportConditions.every(isString)
|
|
126
129
|
) {
|
|
127
|
-
this.
|
|
130
|
+
this._configuredExportConditions = customExportConditions;
|
|
128
131
|
} else {
|
|
129
132
|
throw new Error(
|
|
130
133
|
'Custom export conditions specified but they are not an array of strings'
|
|
@@ -161,15 +164,6 @@ class JSDOMEnvironment {
|
|
|
161
164
|
this.global.removeEventListener('error', this.errorEventListener);
|
|
162
165
|
}
|
|
163
166
|
this.global.close();
|
|
164
|
-
|
|
165
|
-
// Dispose "document" to prevent "load" event from triggering.
|
|
166
|
-
|
|
167
|
-
// Note that this.global.close() will trigger the CustomElement::disconnectedCallback
|
|
168
|
-
// Do not reset the document before CustomElement disconnectedCallback function has finished running,
|
|
169
|
-
// document should be accessible within disconnectedCallback.
|
|
170
|
-
Object.defineProperty(this.global, 'document', {
|
|
171
|
-
value: null
|
|
172
|
-
});
|
|
173
167
|
}
|
|
174
168
|
this.errorEventListener = null;
|
|
175
169
|
// @ts-expect-error: this.global not allowed to be `null`
|
|
@@ -179,7 +173,7 @@ class JSDOMEnvironment {
|
|
|
179
173
|
this.fakeTimersModern = null;
|
|
180
174
|
}
|
|
181
175
|
exportConditions() {
|
|
182
|
-
return this.customExportConditions;
|
|
176
|
+
return this._configuredExportConditions ?? this.customExportConditions;
|
|
183
177
|
}
|
|
184
178
|
getVmContext() {
|
|
185
179
|
if (this.dom) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "jest-environment-jsdom",
|
|
3
|
-
"version": "29.
|
|
3
|
+
"version": "29.6.0",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "https://github.com/facebook/jest.git",
|
|
@@ -17,17 +17,17 @@
|
|
|
17
17
|
"./package.json": "./package.json"
|
|
18
18
|
},
|
|
19
19
|
"dependencies": {
|
|
20
|
-
"@jest/environment": "^29.
|
|
21
|
-
"@jest/fake-timers": "^29.
|
|
22
|
-
"@jest/types": "^29.
|
|
20
|
+
"@jest/environment": "^29.6.0",
|
|
21
|
+
"@jest/fake-timers": "^29.6.0",
|
|
22
|
+
"@jest/types": "^29.6.0",
|
|
23
23
|
"@types/jsdom": "^20.0.0",
|
|
24
24
|
"@types/node": "*",
|
|
25
|
-
"jest-mock": "^29.
|
|
26
|
-
"jest-util": "^29.
|
|
25
|
+
"jest-mock": "^29.6.0",
|
|
26
|
+
"jest-util": "^29.6.0",
|
|
27
27
|
"jsdom": "^20.0.0"
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|
|
30
|
-
"@jest/test-utils": "^29.
|
|
30
|
+
"@jest/test-utils": "^29.6.0"
|
|
31
31
|
},
|
|
32
32
|
"peerDependencies": {
|
|
33
33
|
"canvas": "^2.5.0"
|
|
@@ -43,5 +43,5 @@
|
|
|
43
43
|
"publishConfig": {
|
|
44
44
|
"access": "public"
|
|
45
45
|
},
|
|
46
|
-
"gitHead": "
|
|
46
|
+
"gitHead": "c1e5b8a38ef54bb138409f89831942ebf6a7a67e"
|
|
47
47
|
}
|