@happy-dom/jest-environment
Advanced tools
Comparing version 2.20.1 to 2.21.0
@@ -78,3 +78,2 @@ "use strict"; | ||
function HappyDOMEnvironment(config, options) { | ||
if (options === void 0) { options = {}; } | ||
this.fakeTimers = null; | ||
@@ -89,2 +88,6 @@ this.fakeTimersModern = null; | ||
this.global.Error.stackTraceLimit = 100; | ||
// TODO: Remove this ASAP as it currently causes tests to run really slow. | ||
this.global.Buffer = Buffer; | ||
// Needed as Jest is using it | ||
this.global.global = this.global; | ||
JestUtil.installCommonGlobals(this.global, config.globals); | ||
@@ -94,3 +97,3 @@ // Removes window.fetch() as it should not be used in a test environment. | ||
delete this.global.window['fetch']; | ||
if (options.console) { | ||
if (options && options.console) { | ||
this.global.console = options.console; | ||
@@ -97,0 +100,0 @@ this.global.window['console'] = options.console; |
{ | ||
"name": "@happy-dom/jest-environment", | ||
"version": "2.20.1", | ||
"version": "2.21.0", | ||
"license": "MIT", | ||
@@ -53,8 +53,8 @@ "homepage": "https://github.com/capricorn86/happy-dom/tree/master/packages/jest-environment", | ||
"dependencies": { | ||
"@jest/environment": "^26.6.2", | ||
"@jest/fake-timers": "^26.6.2", | ||
"@jest/types": "^26.6.2", | ||
"happy-dom": "^2.20.1", | ||
"jest-mock": "^26.6.2", | ||
"jest-util": "^26.6.2" | ||
"@jest/environment": "^27.0.3", | ||
"@jest/fake-timers": "^27.0.3", | ||
"@jest/types": "^27.0.2", | ||
"happy-dom": "^2.21.0", | ||
"jest-mock": "^27.0.3", | ||
"jest-util": "^27.0.2" | ||
}, | ||
@@ -79,3 +79,3 @@ "devDependencies": { | ||
"eslint-plugin-prettier": "^3.4.0", | ||
"jest": "^26.6.3", | ||
"jest": "^27.0.4", | ||
"jquery": "^3.5.1", | ||
@@ -86,3 +86,3 @@ "lit-element": "^2.4.0", | ||
"react-dom": "^16.13.1", | ||
"ts-jest": "^26.5.6", | ||
"ts-jest": "^27.0.3", | ||
"typescript": "^4.2.4", | ||
@@ -92,3 +92,3 @@ "vue": "^2.6.12", | ||
}, | ||
"gitHead": "677f1705df2cedcd5852bc721b07053be1b403c4" | ||
"gitHead": "cf68a99486818304511ab14facadc8a0fad2139a" | ||
} |
@@ -27,3 +27,3 @@ /* eslint-disable filenames/match-exported */ | ||
*/ | ||
constructor(config: Config.ProjectConfig, options: EnvironmentContext = {}) { | ||
constructor(config: Config.ProjectConfig, options?: EnvironmentContext) { | ||
VM.createContext(this.global); | ||
@@ -37,2 +37,8 @@ | ||
// TODO: Remove this ASAP as it currently causes tests to run really slow. | ||
this.global.Buffer = Buffer; | ||
// Needed as Jest is using it | ||
this.global.global = this.global; | ||
JestUtil.installCommonGlobals(this.global, config.globals); | ||
@@ -44,3 +50,3 @@ | ||
if (options.console) { | ||
if (options && options.console) { | ||
this.global.console = options.console; | ||
@@ -47,0 +53,0 @@ this.global.window['console'] = options.console; |
Sorry, the diff of this file is not supported yet
29039
635
+ Added@jest/environment@27.5.1(transitive)
+ Added@jest/fake-timers@27.5.1(transitive)
+ Added@jest/types@27.5.1(transitive)
+ Added@sinonjs/fake-timers@8.1.0(transitive)
+ Added@types/yargs@16.0.9(transitive)
+ Addedansi-styles@5.2.0(transitive)
+ Addedci-info@3.9.0(transitive)
+ Addedjest-message-util@27.5.1(transitive)
+ Addedjest-mock@27.5.1(transitive)
+ Addedjest-util@27.5.1(transitive)
+ Addedpretty-format@27.5.1(transitive)
- Removed@jest/environment@26.6.2(transitive)
- Removed@jest/fake-timers@26.6.2(transitive)
- Removed@jest/types@26.6.2(transitive)
- Removed@sinonjs/fake-timers@6.0.1(transitive)
- Removed@types/yargs@15.0.19(transitive)
- Removedci-info@2.0.0(transitive)
- Removedis-ci@2.0.0(transitive)
- Removedjest-message-util@26.6.2(transitive)
- Removedjest-mock@26.6.2(transitive)
- Removedjest-util@26.6.2(transitive)
- Removedpretty-format@26.6.2(transitive)
Updated@jest/environment@^27.0.3
Updated@jest/fake-timers@^27.0.3
Updated@jest/types@^27.0.2
Updatedhappy-dom@^2.21.0
Updatedjest-mock@^27.0.3
Updatedjest-util@^27.0.2