@types/jest
Advanced tools
Comparing version 23.3.2 to 23.3.3
@@ -200,3 +200,3 @@ // Type definitions for Jest 23.3 | ||
*/ | ||
function spyOn<T extends {}, M extends keyof T>(object: T, method: M, accessType?: 'get' | 'set'): SpyInstance<T[M]>; | ||
function spyOn<T extends {}, M extends keyof T>(object: T, method: M, accessType?: 'get' | 'set'): MockInstance<T[M]>; | ||
/** | ||
@@ -730,12 +730,2 @@ * Indicates that the module system should never return a mocked version of | ||
interface SpyInstance<T = {}> extends MockInstance<T> { | ||
/** | ||
* Removes the mock and restores the initial implementation. | ||
* | ||
* This is useful when you want to mock functions in certain test cases and restore the | ||
* original implementation in others. | ||
*/ | ||
mockRestore(): void; | ||
} | ||
/** | ||
@@ -782,2 +772,14 @@ * Wrap module with mock definitions | ||
/** | ||
* Does everything that `mockFn.mockReset()` does, and also restores the original (non-mocked) implementation. | ||
* | ||
* This is useful when you want to mock functions in certain test cases and restore the original implementation in others. | ||
* | ||
* Beware that `mockFn.mockRestore` only works when mock was created with `jest.spyOn`. Thus you have to take care of restoration | ||
* yourself when manually assigning `jest.fn()`. | ||
* | ||
* The [`restoreMocks`](https://jestjs.io/docs/en/configuration.html#restoremocks-boolean) configuration option is available | ||
* to restore mocks automatically between tests. | ||
*/ | ||
mockRestore(): void; | ||
/** | ||
* Accepts a function that should be used as the implementation of the mock. The mock itself will still record | ||
@@ -784,0 +786,0 @@ * all calls that go into and instances that come from itself – the only difference is that the implementation |
{ | ||
"name": "@types/jest", | ||
"version": "23.3.2", | ||
"version": "23.3.3", | ||
"description": "TypeScript definitions for Jest", | ||
@@ -94,4 +94,4 @@ "license": "MIT", | ||
"dependencies": {}, | ||
"typesPublisherContentHash": "6697a48e53476de8b74fc1f4ecccd784040be0fe9fd47a51a546c4cd4991cd8a", | ||
"typesPublisherContentHash": "80f93ad45640e9ceafdab2d0c0b9e675e407bc9dea027b34092b977631b57434", | ||
"typeScriptVersion": "2.3" | ||
} |
@@ -11,3 +11,3 @@ # Installation | ||
Additional Details | ||
* Last updated: Sat, 08 Sep 2018 01:20:16 GMT | ||
* Last updated: Wed, 03 Oct 2018 17:56:18 GMT | ||
* Dependencies: none | ||
@@ -14,0 +14,0 @@ * Global values: afterAll, afterEach, beforeAll, beforeEach, describe, expect, fail, fdescribe, fit, it, jasmine, jest, pending, spyOn, test, xdescribe, xit, xtest |
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
64280
1547