@types/jest-when
Advanced tools
Comparing version 2.7.2 to 2.7.3
// Type definitions for jest-when 2.7 | ||
// Project: https://github.com/timkindberg/jest-when#readme | ||
// Definitions by: Alden Taylor <https://github.com/aldentaylor> | ||
// Trung Dang <https://github.com/immanuel192> | ||
// Gregor Stamać <https://github.com/gstamac> | ||
// Valentin Stern <https://github.com/sehsyha> | ||
// Definitions by: Alden Taylor <https://github.com/aldentaylor>, | ||
// Trung Dang <https://github.com/immanuel192>, | ||
// Gregor Stamać <https://github.com/gstamac>, | ||
// Valentin Stern <https://github.com/sehsyha>, | ||
// Nicholas Hehr <https://github.com/hipsterbrown> | ||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped | ||
@@ -26,3 +27,3 @@ // TypeScript Version: 3.8 | ||
export type When = <T, Y extends any[]>(fn: jest.MockInstance<T, Y>) => WhenMock<T, Y>; | ||
export type When = <T, Y extends any[]>(fn: ((...args: Y) => T) | jest.MockInstance<T, Y>) => WhenMock<T, Y>; | ||
@@ -29,0 +30,0 @@ export const when: When; |
{ | ||
"name": "@types/jest-when", | ||
"version": "2.7.2", | ||
"version": "2.7.3", | ||
"description": "TypeScript definitions for jest-when", | ||
"homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/jest-when", | ||
"license": "MIT", | ||
@@ -26,2 +27,7 @@ "contributors": [ | ||
"githubUsername": "sehsyha" | ||
}, | ||
{ | ||
"name": "Nicholas Hehr", | ||
"url": "https://github.com/hipsterbrown", | ||
"githubUsername": "hipsterbrown" | ||
} | ||
@@ -40,4 +46,4 @@ ], | ||
}, | ||
"typesPublisherContentHash": "80280c1f351d210550666e9bffbe313e97a24307f3fe61780d0502fb088bd592", | ||
"typesPublisherContentHash": "ff6414c0650b1bd2e3b99252f0c9d32587e8d29d6f6db9f462b153b5da41718f", | ||
"typeScriptVersion": "3.8" | ||
} |
@@ -9,5 +9,40 @@ # Installation | ||
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/jest-when. | ||
## [index.d.ts](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/jest-when/index.d.ts) | ||
````ts | ||
// Type definitions for jest-when 2.7 | ||
// Project: https://github.com/timkindberg/jest-when#readme | ||
// Definitions by: Alden Taylor <https://github.com/aldentaylor>, | ||
// Trung Dang <https://github.com/immanuel192>, | ||
// Gregor Stamać <https://github.com/gstamac>, | ||
// Valentin Stern <https://github.com/sehsyha>, | ||
// Nicholas Hehr <https://github.com/hipsterbrown> | ||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped | ||
// TypeScript Version: 3.8 | ||
/// <reference types="jest" /> | ||
export interface WhenMock<T = any, Y extends any[] = any> | ||
extends jest.MockInstance<T, Y> { | ||
calledWith(...matchers: Y): this; | ||
expectCalledWith(...matchers: Y): this; | ||
mockReturnValue(value: T): this; | ||
mockReturnValueOnce(value: T): this; | ||
mockResolvedValue(value: jest.ResolvedValue<T>): this; | ||
mockResolvedValueOnce(value: jest.ResolvedValue<T>): this; | ||
mockRejectedValue(value: jest.RejectedValue<T>): this; | ||
mockRejectedValueOnce(value: jest.RejectedValue<T>): this; | ||
mockImplementation(fn: (...args: Y) => T): this; | ||
mockImplementationOnce(fn?: (...args: Y) => T): this; | ||
} | ||
export type When = <T, Y extends any[]>(fn: ((...args: Y) => T) | jest.MockInstance<T, Y>) => WhenMock<T, Y>; | ||
export const when: When; | ||
export function resetAllWhenMocks(): void; | ||
export function verifyAllWhenMocksCalled(): void; | ||
```` | ||
### Additional Details | ||
* Last updated: Tue, 20 Oct 2020 07:15:45 GMT | ||
* Last updated: Mon, 07 Jun 2021 15:31:27 GMT | ||
* Dependencies: [@types/jest](https://npmjs.com/package/@types/jest) | ||
@@ -17,2 +52,2 @@ * Global values: none | ||
# Credits | ||
These definitions were written by [Alden Taylor](https://github.com/aldentaylor), [Trung Dang](https://github.com/immanuel192), [Gregor Stamać](https://github.com/gstamac), and [Valentin Stern](https://github.com/sehsyha). | ||
These definitions were written by [Alden Taylor](https://github.com/aldentaylor), [Trung Dang](https://github.com/immanuel192), [Gregor Stamać](https://github.com/gstamac), [Valentin Stern](https://github.com/sehsyha), and [Nicholas Hehr](https://github.com/hipsterbrown). |
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
No website
QualityPackage does not have a website.
Found 1 instance in 1 package
6195
27
0
52