mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-04-17 12:16:38 +08:00
Fix mocked type
This commit is contained in:
12
jest/index.d.ts
vendored
12
jest/index.d.ts
vendored
@@ -109,7 +109,7 @@ declare namespace jest {
|
||||
interface It {
|
||||
/**
|
||||
* Creates a test closure.
|
||||
*
|
||||
*
|
||||
* @param {string} name The name of your test
|
||||
* @param {fn?} ProvidesCallback The function for your test
|
||||
*/
|
||||
@@ -152,9 +152,9 @@ declare namespace jest {
|
||||
|
||||
/** The `expect` function is used every time you want to test a value. You will rarely call `expect` by itself. */
|
||||
interface Expect {
|
||||
/**
|
||||
* The `expect` function is used every time you want to test a value. You will rarely call `expect` by itself.
|
||||
*
|
||||
/**
|
||||
* The `expect` function is used every time you want to test a value. You will rarely call `expect` by itself.
|
||||
*
|
||||
* @param {any} actual The value to apply matchers against.
|
||||
*/
|
||||
(actual: any): Matchers;
|
||||
@@ -255,8 +255,8 @@ declare namespace jest {
|
||||
* myApi.myApiMethod.mockImplementation(() => "test");
|
||||
*/
|
||||
type Mocked<T> = {
|
||||
[P in keyof T]: T[P] & MockInstance<T>;
|
||||
};
|
||||
[P in keyof T]: T[P] & MockInstance<T[P]>;
|
||||
} & T;
|
||||
|
||||
interface MockInstance<T> {
|
||||
mock: MockContext<T>;
|
||||
|
||||
@@ -433,6 +433,7 @@ describe('strictNullChecks', function () {
|
||||
class TestApi {
|
||||
constructor() { };
|
||||
testProp: boolean;
|
||||
private anotherProp: string;
|
||||
testMethod(a: number): string { return ""; }
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user