jest-environment-node
Advanced tools
Comparing version 20.0.3 to 20.1.0-alpha.1
@@ -1,10 +0,2 @@ | ||
'use strict'; /** | ||
* Copyright (c) 2014-present, Facebook, Inc. All rights reserved. | ||
* | ||
* This source code is licensed under the BSD-style license found in the | ||
* LICENSE file in the root directory of this source tree. An additional grant | ||
* of patent rights can be found in the PATENTS file in the same directory. | ||
* | ||
* | ||
*/ | ||
'use strict'; | ||
@@ -16,6 +8,14 @@ | ||
const vm = require('vm');var _require = | ||
require('jest-util');const FakeTimers = _require.FakeTimers,installCommonGlobals = _require.installCommonGlobals; | ||
const mock = require('jest-mock'); | ||
var _vm = require('vm');var _vm2 = _interopRequireDefault(_vm); | ||
var _jestUtil = require('jest-util'); | ||
var _jestMock = require('jest-mock');var _jestMock2 = _interopRequireDefault(_jestMock);function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };} | ||
class NodeEnvironment { | ||
@@ -28,4 +28,4 @@ | ||
constructor(config) { | ||
this.context = vm.createContext(); | ||
const global = this.global = vm.runInContext('this', this.context); | ||
this.context = _vm2.default.createContext(); | ||
const global = this.global = _vm2.default.runInContext('this', this.context); | ||
global.global = global; | ||
@@ -37,5 +37,5 @@ global.clearInterval = clearInterval; | ||
global.setTimeout = setTimeout; | ||
installCommonGlobals(global, config.globals); | ||
this.moduleMocker = new mock.ModuleMocker(global); | ||
this.fakeTimers = new FakeTimers(global, this.moduleMocker, config); | ||
(0, _jestUtil.installCommonGlobals)(global, config.globals); | ||
this.moduleMocker = new _jestMock2.default.ModuleMocker(global); | ||
this.fakeTimers = new _jestUtil.FakeTimers(global, this.moduleMocker, config); | ||
} | ||
@@ -51,3 +51,6 @@ | ||
// Disabling rule as return type depends on script's return type. | ||
/* eslint-disable flowtype/no-weak-types */ | ||
runScript(script) { | ||
/* eslint-enable flowtype/no-weak-types */ | ||
if (this.context) { | ||
@@ -57,5 +60,10 @@ return script.runInContext(this.context); | ||
return null; | ||
}} | ||
module.exports = NodeEnvironment; | ||
}} /** | ||
* Copyright (c) 2014-present, Facebook, Inc. All rights reserved. | ||
* | ||
* This source code is licensed under the BSD-style license found in the | ||
* LICENSE file in the root directory of this source tree. An additional grant | ||
* of patent rights can be found in the PATENTS file in the same directory. | ||
* | ||
* | ||
*/module.exports = NodeEnvironment; |
{ | ||
"name": "jest-environment-node", | ||
"version": "20.0.3", | ||
"version": "20.1.0-alpha.1", | ||
"repository": { | ||
@@ -11,5 +11,5 @@ "type": "git", | ||
"dependencies": { | ||
"jest-mock": "^20.0.3", | ||
"jest-util": "^20.0.3" | ||
"jest-mock": "^20.1.0-alpha.1", | ||
"jest-util": "^20.1.0-alpha.1" | ||
} | ||
} |
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
2099
41
2
+ Addedansi-regex@3.0.1(transitive)
+ Addedchalk@2.4.2(transitive)
+ Addedhas-flag@3.0.0(transitive)
+ Addedjest-get-type@20.1.0-echo.1(transitive)
+ Addedjest-message-util@20.1.0-echo.1(transitive)
+ Addedjest-mock@20.1.0-echo.1(transitive)
+ Addedjest-util@20.1.0-echo.1(transitive)
+ Addedjest-validate@20.1.0-echo.1(transitive)
+ Addedpretty-format@20.1.0-echo.1(transitive)
+ Addedsupports-color@5.5.0(transitive)
- Removedansi-regex@2.1.1(transitive)
- Removedansi-styles@2.2.1(transitive)
- Removedchalk@1.1.3(transitive)
- Removedhas-ansi@2.0.0(transitive)
- Removedjest-matcher-utils@20.0.3(transitive)
- Removedjest-message-util@20.0.3(transitive)
- Removedjest-mock@20.0.3(transitive)
- Removedjest-util@20.0.3(transitive)
- Removedjest-validate@20.0.3(transitive)
- Removedpretty-format@20.0.3(transitive)
- Removedstrip-ansi@3.0.1(transitive)
- Removedsupports-color@2.0.0(transitive)
Updatedjest-mock@^20.1.0-alpha.1
Updatedjest-util@^20.1.0-alpha.1