@types/jest
Advanced tools
Comparing version 24.0.1 to 24.0.2
@@ -39,4 +39,2 @@ // Type definitions for Jest 24.0 | ||
type ArgsType<T> = T extends (...args: infer A) => any ? A : never; | ||
interface NodeRequire { | ||
@@ -241,2 +239,5 @@ /** | ||
type EmptyFunction = () => void; | ||
type ArgsType<T> = T extends (...args: infer A) => any ? A : never; | ||
type RejectedValue<T> = T extends PromiseLike<any> ? any : never; | ||
type ResolvedValue<T> = T extends PromiseLike<infer U> ? U | T : never; | ||
// see https://github.com/Microsoft/TypeScript/issues/25215 | ||
@@ -812,3 +813,3 @@ type NonFunctionPropertyNames<T> = { [K in keyof T]: T[K] extends (...args: any[]) => any ? never : K }[keyof T] & string; | ||
type Mocked<T> = { | ||
[P in keyof T]: T[P] & MockInstance<T[P], ArgsType<T[P]>>; | ||
[P in keyof T]: T[P] extends (...args: any[]) => any ? MockInstance<ReturnType<T[P]>, ArgsType<T[P]>>: T[P]; | ||
} & T; | ||
@@ -921,3 +922,3 @@ | ||
*/ | ||
mockResolvedValue(value: T | PromiseLike<T>): Mock<Promise<T>, Y>; | ||
mockResolvedValue(value: ResolvedValue<T>): Mock<T, Y>; | ||
/** | ||
@@ -942,3 +943,3 @@ * Simple sugar function for: `jest.fn().mockImplementationOnce(() => Promise.resolve(value));` | ||
*/ | ||
mockResolvedValueOnce(value: T | PromiseLike<T>): Mock<Promise<T>, Y>; | ||
mockResolvedValueOnce(value: ResolvedValue<T>): Mock<T, Y>; | ||
/** | ||
@@ -955,3 +956,3 @@ * Simple sugar function for: `jest.fn().mockImplementation(() => Promise.reject(value));` | ||
*/ | ||
mockRejectedValue(value: any): Mock<Promise<T>, Y>; | ||
mockRejectedValue(value: RejectedValue<T>): Mock<T, Y>; | ||
@@ -974,3 +975,3 @@ /** | ||
*/ | ||
mockRejectedValueOnce(value: any): Mock<Promise<T>, Y>; | ||
mockRejectedValueOnce(value: RejectedValue<T>): Mock<T, Y>; | ||
} | ||
@@ -977,0 +978,0 @@ |
{ | ||
"name": "@types/jest", | ||
"version": "24.0.1", | ||
"version": "24.0.2", | ||
"description": "TypeScript definitions for Jest", | ||
@@ -105,4 +105,4 @@ "license": "MIT", | ||
"dependencies": {}, | ||
"typesPublisherContentHash": "7e8090ad443559d38f8c850c5e14ade8046dc61fb10d82918d877458fa6bc9f1", | ||
"typesPublisherContentHash": "31824578a8327e30bcf50b6abd229040f8ca9b6dff72e4b201243842c27111fe", | ||
"typeScriptVersion": "3.0" | ||
} |
@@ -11,3 +11,3 @@ # Installation | ||
Additional Details | ||
* Last updated: Tue, 12 Feb 2019 07:40:39 GMT | ||
* Last updated: Tue, 12 Feb 2019 19:31:01 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
68085
1612