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

@jest/environment

Package Overview
Dependencies
Maintainers
6
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 29.3.1 to 29.4.0

.eslintcache

46

build/index.d.ts

@@ -130,5 +130,13 @@ /**

/**
* Returns the current time in ms of the fake timer clock.
* Returns `true` if test environment has been torn down.
*
* @example
* ```js
* if (jest.isEnvironmentTornDown()) {
* // The Jest environment has been torn down, so stop doing work
* return;
* }
* ```
*/
now(): number;
isEnvironmentTornDown(): boolean;
/**

@@ -146,2 +154,8 @@ * Determines if the given function is a mocked function.

/**
* `jest.isolateModulesAsync()` is the equivalent of `jest.isolateModules()`, but for
* async functions to be wrapped. The caller is expected to `await` the completion of
* `isolateModulesAsync`.
*/
isolateModulesAsync(fn: () => Promise<void>): Promise<void>;
/**
* Mocks a module with an auto-mocked version when it is being required.

@@ -167,2 +181,19 @@ */

/**
* Wraps types of the `source` object and its deep members with type definitions
* of Jest mock function. Pass `{shallow: true}` option to disable the deeply
* mocked behavior.
*/
mocked: ModuleMocker['mocked'];
/**
* Returns the current time in ms of the fake timer clock.
*/
now(): number;
/**
* Replaces property on an object with another value.
*
* @remarks
* For mocking functions or 'get' or 'set' accessors, use `jest.spyOn()` instead.
*/
replaceProperty: ModuleMocker['replaceProperty'];
/**
* Returns the actual module instead of a mock, bypassing all checks on

@@ -191,8 +222,2 @@ * whether the module should receive a mock implementation or not.

/**
* Wraps types of the `source` object and its deep members with type definitions
* of Jest mock function. Pass `{shallow: true}` option to disable the deeply
* mocked behavior.
*/
mocked: ModuleMocker['mocked'];
/**
* Returns a mock module instead of the actual module, bypassing all checks

@@ -213,4 +238,5 @@ * on whether the module should be required normally or not.

/**
* Restores all mocks back to their original value. Equivalent to calling
* `.mockRestore()` on every mocked function.
* Restores all mocks and replaced properties back to their original value.
* Equivalent to calling `.mockRestore()` on every mocked function
* and `.restore()` on every replaced property.
*

@@ -217,0 +243,0 @@ * Beware that `jest.restoreAllMocks()` only works when the mock was created

{
"name": "@jest/environment",
"version": "29.3.1",
"version": "29.4.0",
"repository": {

@@ -20,6 +20,6 @@ "type": "git",

"dependencies": {
"@jest/fake-timers": "^29.3.1",
"@jest/types": "^29.3.1",
"@jest/fake-timers": "^29.4.0",
"@jest/types": "^29.4.0",
"@types/node": "*",
"jest-mock": "^29.3.1"
"jest-mock": "^29.4.0"
},

@@ -32,3 +32,3 @@ "engines": {

},
"gitHead": "05deb8393c4ad71e19be2567b704dfd3a2ab5fc9"
"gitHead": "4bc0e8acaf990e6618a7bed1dca67760c20bb12a"
}
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