jest-environment-jsdom
Advanced tools
Comparing version 29.3.1 to 29.7.0
/** | ||
* Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. | ||
* Copyright (c) Meta Platforms, Inc. and affiliates. | ||
* | ||
@@ -27,2 +27,3 @@ * This source code is licensed under the MIT license found in the | ||
customExportConditions: string[]; | ||
private _configuredExportConditions?; | ||
constructor(config: JestEnvironmentConfig, context: EnvironmentContext); | ||
@@ -29,0 +30,0 @@ setup(): Promise<void>; |
@@ -36,3 +36,3 @@ 'use strict'; | ||
/** | ||
* Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. | ||
* Copyright (c) Meta Platforms, Inc. and affiliates. | ||
* | ||
@@ -43,2 +43,4 @@ * This source code is licensed under the MIT license found in the | ||
// The `Window` interface does not have an `Error.stackTraceLimit` property, but | ||
// `JSDOMEnvironment` assumes it is there. | ||
function isString(value) { | ||
@@ -55,2 +57,3 @@ return typeof value === 'string'; | ||
customExportConditions = ['browser']; | ||
_configuredExportConditions; | ||
constructor(config, context) { | ||
@@ -83,3 +86,3 @@ const {projectConfig} = config; | ||
); | ||
const global = (this.global = this.dom.window.document.defaultView); | ||
const global = (this.global = this.dom.window); | ||
if (global == null) { | ||
@@ -131,3 +134,3 @@ throw new Error('JSDOM did not return a Window object'); | ||
) { | ||
this.customExportConditions = customExportConditions; | ||
this._configuredExportConditions = customExportConditions; | ||
} else { | ||
@@ -169,11 +172,2 @@ throw new Error( | ||
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 | ||
}); | ||
} | ||
@@ -188,3 +182,3 @@ this.errorEventListener = null; | ||
exportConditions() { | ||
return this.customExportConditions; | ||
return this._configuredExportConditions ?? this.customExportConditions; | ||
} | ||
@@ -191,0 +185,0 @@ getVmContext() { |
{ | ||
"name": "jest-environment-jsdom", | ||
"version": "29.3.1", | ||
"version": "29.7.0", | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/facebook/jest.git", | ||
"url": "https://github.com/jestjs/jest.git", | ||
"directory": "packages/jest-environment-jsdom" | ||
@@ -20,13 +20,13 @@ }, | ||
"dependencies": { | ||
"@jest/environment": "^29.3.1", | ||
"@jest/fake-timers": "^29.3.1", | ||
"@jest/types": "^29.3.1", | ||
"@jest/environment": "^29.7.0", | ||
"@jest/fake-timers": "^29.7.0", | ||
"@jest/types": "^29.6.3", | ||
"@types/jsdom": "^20.0.0", | ||
"@types/node": "*", | ||
"jest-mock": "^29.3.1", | ||
"jest-util": "^29.3.1", | ||
"jest-mock": "^29.7.0", | ||
"jest-util": "^29.7.0", | ||
"jsdom": "^20.0.0" | ||
}, | ||
"devDependencies": { | ||
"@jest/test-utils": "^29.3.1" | ||
"@jest/test-utils": "^29.7.0" | ||
}, | ||
@@ -47,3 +47,3 @@ "peerDependencies": { | ||
}, | ||
"gitHead": "05deb8393c4ad71e19be2567b704dfd3a2ab5fc9" | ||
"gitHead": "4e56991693da7cd4c3730dc3579a1dd1403ee630" | ||
} |
Sorry, the diff of this file is not supported yet
9211
219
+ Added@types/node@22.0.2(transitive)
+ Addedundici-types@6.11.1(transitive)
- Removed@types/node@22.1.0(transitive)
- Removedundici-types@6.13.0(transitive)
Updated@jest/environment@^29.7.0
Updated@jest/fake-timers@^29.7.0
Updated@jest/types@^29.6.3
Updatedjest-mock@^29.7.0
Updatedjest-util@^29.7.0