Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@jest/environment

Package Overview
Dependencies
Maintainers
7
Versions
122
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@jest/environment - npm Package Compare versions

Comparing version 26.6.2 to 27.0.0-next.0

35

build/index.d.ts

@@ -11,5 +11,3 @@ /**

import type { Circus, Config, Global } from '@jest/types';
import jestMock = require('jest-mock');
declare type JestMockFn = typeof jestMock.fn;
declare type JestMockSpyOn = typeof jestMock.spyOn;
import type { fn as JestMockFn, spyOn as JestMockSpyOn, ModuleMocker } from 'jest-mock';
export declare type EnvironmentContext = Partial<{

@@ -20,3 +18,3 @@ console: Console;

}>;
export declare type ModuleWrapper = (this: Module['exports'], module: Module, exports: Module['exports'], require: Module['require'], __dirname: string, __filename: Module['filename'], global: Global.Global, jest?: Jest, ...extraGlobals: Array<Global.Global[keyof Global.Global]>) => unknown;
export declare type ModuleWrapper = (this: Module['exports'], module: Module, exports: Module['exports'], require: Module['require'], __dirname: string, __filename: Module['filename'], jest?: Jest, ...extraGlobals: Array<Global.Global[keyof Global.Global]>) => unknown;
export declare class JestEnvironment {

@@ -27,3 +25,3 @@ constructor(config: Config.ProjectConfig, context?: EnvironmentContext);

fakeTimersModern: ModernFakeTimers | null;
moduleMocker: jestMock.ModuleMocker | null;
moduleMocker: ModuleMocker | null;
/**

@@ -41,8 +39,2 @@ * @deprecated implement getVmContext instead

/**
* Provides a way to add Jasmine-compatible matchers into your Jest context.
*
* @deprecated Use `expect.extend` instead
*/
addMatchers(matchers: Record<string, unknown>): void;
/**
* Advances all timers by the needed milliseconds so that only the next timeouts/intervals will run.

@@ -103,3 +95,3 @@ * Optionally, you can provide steps, so it will run steps amount of next timeouts/intervals.

*/
fn: JestMockFn;
fn: typeof JestMockFn;
/**

@@ -126,3 +118,3 @@ * Given the name of a module, use the automatic mocking system to generate a

*/
isMockFunction(fn: (...args: Array<any>) => unknown): fn is ReturnType<JestMockFn>;
isMockFunction(fn: (...args: Array<any>) => unknown): fn is ReturnType<typeof JestMockFn>;
/**

@@ -169,10 +161,3 @@ * Mocks a module with an auto-mocked version when it is being required.

* useful to isolate modules where local state might conflict between tests.
*
* @deprecated Use `jest.resetModules()`
*/
resetModuleRegistry(): Jest;
/**
* Resets the module registry - the cache of all required modules. This is
* useful to isolate modules where local state might conflict between tests.
*/
resetModules(): Jest;

@@ -222,9 +207,2 @@ /**

/**
* Executes only the macro task queue (i.e. all tasks queued by setTimeout()
* or setInterval() and setImmediate()).
*
* @deprecated Use `jest.advanceTimersByTime()`
*/
runTimersToTime(msToRun: number): void;
/**
* Returns the number of fake timers still left to run.

@@ -257,3 +235,3 @@ */

*/
spyOn: JestMockSpyOn;
spyOn: typeof JestMockSpyOn;
/**

@@ -293,2 +271,1 @@ * Indicates that the module system should never return a mocked version of

}
export {};
'use strict';
function _jestMock() {
const data = _interopRequireDefault(require('jest-mock'));
_jestMock = function () {
return data;
};
return data;
}
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {default: obj};
}

20

package.json
{
"name": "@jest/environment",
"version": "26.6.2",
"version": "27.0.0-next.0",
"repository": {

@@ -10,12 +10,16 @@ "type": "git",

"license": "MIT",
"main": "build/index.js",
"types": "build/index.d.ts",
"main": "./build/index.js",
"types": "./build/index.d.ts",
"exports": {
".": "./build/index.js",
"./package.json": "./package.json"
},
"dependencies": {
"@jest/fake-timers": "^26.6.2",
"@jest/types": "^26.6.2",
"@jest/fake-timers": "^27.0.0-next.0",
"@jest/types": "^27.0.0-next.0",
"@types/node": "*",
"jest-mock": "^26.6.2"
"jest-mock": "^27.0.0-next.0"
},
"engines": {
"node": ">= 10.14.2"
"node": "^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0"
},

@@ -25,3 +29,3 @@ "publishConfig": {

},
"gitHead": "4c46930615602cbf983fb7e8e82884c282a624d5"
"gitHead": "4f77c70602cab8419794f10fa39510f13baafef8"
}
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