jest-environment-node
Advanced tools
Comparing version 16.0.2 to 16.1.0-alpha.691b0e22
@@ -21,4 +21,2 @@ /** | ||
const isNaN = global.isNaN; | ||
class NodeEnvironment { | ||
@@ -30,14 +28,13 @@ | ||
constructor(config) { | ||
const global = this.global = {}; | ||
vm.createContext(this.global); | ||
this.context = vm.createContext(); | ||
const global = this.global = vm.runInContext('this', this.context); | ||
global.global = global; | ||
global.clearInterval = clearInterval; | ||
global.clearTimeout = clearTimeout; | ||
global.JSON = JSON; | ||
global.Promise = Promise; | ||
global.setInterval = setInterval; | ||
global.setTimeout = setTimeout; | ||
global.isNaN = isNaN; | ||
global.ArrayBuffer = ArrayBuffer; | ||
global.JSON = JSON; | ||
global.Promise = Promise; | ||
installCommonGlobals(global, config.globals); | ||
@@ -52,3 +49,3 @@ this.moduleMocker = new ModuleMocker(); | ||
} | ||
this.global = null; | ||
this.context = null; | ||
this.fakeTimers = null; | ||
@@ -58,4 +55,4 @@ } | ||
runScript(script) { | ||
if (this.global) { | ||
return script.runInContext(this.global); | ||
if (this.context) { | ||
return script.runInContext(this.context); | ||
} | ||
@@ -62,0 +59,0 @@ return null; |
{ | ||
"name": "jest-environment-node", | ||
"version": "16.0.2", | ||
"version": "16.1.0-alpha.691b0e22", | ||
"repository": { | ||
@@ -11,4 +11,4 @@ "type": "git", | ||
"dependencies": { | ||
"jest-mock": "^16.0.2", | ||
"jest-util": "^16.0.2" | ||
"jest-mock": "^16.1.0-alpha.691b0e22", | ||
"jest-util": "^16.1.0-alpha.691b0e22" | ||
}, | ||
@@ -15,0 +15,0 @@ "scripts": { |
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
1838
42
2
+ Addedjest-file-exists@16.1.0-alpha.691b0e22(transitive)
+ Addedjest-mock@16.1.0-alpha.691b0e22(transitive)
+ Addedjest-util@16.1.0-alpha.691b0e22(transitive)
- Removedjest-file-exists@15.0.0(transitive)
- Removedjest-mock@16.0.2(transitive)
- Removedjest-util@16.0.2(transitive)