Fix mocked type

This commit is contained in:
Alexey Svetliakov 2017-01-31 23:53:42 +01:00
parent 8cb9653398
commit 1ace18d67a
2 changed files with 7 additions and 6 deletions

12
jest/index.d.ts vendored
View File

@ -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>;

View File

@ -433,6 +433,7 @@ describe('strictNullChecks', function () {
class TestApi {
constructor() { };
testProp: boolean;
private anotherProp: string;
testMethod(a: number): string { return ""; }
}