New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

jest-environment-node

Package Overview
Dependencies
Maintainers
2
Versions
276
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jest-environment-node - npm Package Compare versions

Comparing version 20.0.3 to 20.1.0-alpha.1

50

build/index.js

@@ -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"
}
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc