jest-environment-jsdom
Advanced tools
Comparing version 28.0.2 to 28.1.0
@@ -26,2 +26,3 @@ /** | ||
moduleMocker: ModuleMocker | null; | ||
customExportConditions: string[]; | ||
constructor(config: JestEnvironmentConfig, context: EnvironmentContext); | ||
@@ -28,0 +29,0 @@ setup(): Promise<void>; |
@@ -61,2 +61,3 @@ 'use strict'; | ||
moduleMocker; | ||
customExportConditions = ['browser']; | ||
@@ -133,2 +134,17 @@ constructor(config, context) { | ||
if ('customExportConditions' in projectConfig.testEnvironmentOptions) { | ||
const {customExportConditions} = projectConfig.testEnvironmentOptions; | ||
if ( | ||
Array.isArray(customExportConditions) && | ||
customExportConditions.every(item => typeof item === 'string') | ||
) { | ||
this.customExportConditions = customExportConditions; | ||
} else { | ||
throw new Error( | ||
'Custom export conditions specified but they are not an array of strings' | ||
); | ||
} | ||
} | ||
this.moduleMocker = new (_jestMock().ModuleMocker)(global); | ||
@@ -185,3 +201,3 @@ this.fakeTimers = new (_fakeTimers().LegacyFakeTimers)({ | ||
exportConditions() { | ||
return ['browser']; | ||
return this.customExportConditions; | ||
} | ||
@@ -188,0 +204,0 @@ |
{ | ||
"name": "jest-environment-jsdom", | ||
"version": "28.0.2", | ||
"version": "28.1.0", | ||
"repository": { | ||
@@ -20,13 +20,13 @@ "type": "git", | ||
"dependencies": { | ||
"@jest/environment": "^28.0.2", | ||
"@jest/fake-timers": "^28.0.2", | ||
"@jest/types": "^28.0.2", | ||
"@jest/environment": "^28.1.0", | ||
"@jest/fake-timers": "^28.1.0", | ||
"@jest/types": "^28.1.0", | ||
"@types/jsdom": "^16.2.4", | ||
"@types/node": "*", | ||
"jest-mock": "^28.0.2", | ||
"jest-util": "^28.0.2", | ||
"jest-mock": "^28.1.0", | ||
"jest-util": "^28.1.0", | ||
"jsdom": "^19.0.0" | ||
}, | ||
"devDependencies": { | ||
"@jest/test-utils": "^28.0.2" | ||
"@jest/test-utils": "^28.1.0" | ||
}, | ||
@@ -39,3 +39,3 @@ "engines": { | ||
}, | ||
"gitHead": "279ee6658d763f024d51f340fab6a37c17d94502" | ||
"gitHead": "f5db241312f46528389e55c38221e6b6968622cf" | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
9127
211
Updated@jest/environment@^28.1.0
Updated@jest/fake-timers@^28.1.0
Updated@jest/types@^28.1.0
Updatedjest-mock@^28.1.0
Updatedjest-util@^28.1.0