jest-environment-jsdom 29.5.0 → 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 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.customExportConditions = customExportConditions;
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'
@@ -170,7 +173,7 @@ class JSDOMEnvironment {
170
173
  this.fakeTimersModern = null;
171
174
  }
172
175
  exportConditions() {
173
- return this.customExportConditions;
176
+ return this._configuredExportConditions ?? this.customExportConditions;
174
177
  }
175
178
  getVmContext() {
176
179
  if (this.dom) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jest-environment-jsdom",
3
- "version": "29.5.0",
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.5.0",
21
- "@jest/fake-timers": "^29.5.0",
22
- "@jest/types": "^29.5.0",
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.5.0",
26
- "jest-util": "^29.5.0",
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.5.0"
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": "39f3beda6b396665bebffab94e8d7c45be30454c"
46
+ "gitHead": "c1e5b8a38ef54bb138409f89831942ebf6a7a67e"
47
47
  }