@jest/environment
Advanced tools
Comparing version 29.3.1 to 29.4.0
@@ -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" | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
14925
5
374
Updated@jest/fake-timers@^29.4.0
Updated@jest/types@^29.4.0
Updatedjest-mock@^29.4.0