diff --git a/types/jest/index.d.ts b/types/jest/index.d.ts index fa1cb4074a..a9cbdbc1e3 100644 --- a/types/jest/index.d.ts +++ b/types/jest/index.d.ts @@ -775,7 +775,7 @@ declare namespace jest { * * Note: `jest.fn(implementation)` is a shorthand for `jest.fn().mockImplementation(implementation)`. */ - mockImplementation(fn: (...args: any[]) => any): Mock; + mockImplementation(fn?: (...args: any[]) => any): Mock; /** * Accepts a function that will be used as an implementation of the mock for one call to the mocked function. * Can be chained so that multiple function calls produce different results. diff --git a/types/jest/jest-tests.ts b/types/jest/jest-tests.ts index 9eb14a5751..801c6a5a78 100644 --- a/types/jest/jest-tests.ts +++ b/types/jest/jest-tests.ts @@ -298,6 +298,7 @@ spy2.mockReset(); const spy3Mock: jest.Mock<() => string> = spy3 .mockImplementation(() => "") + .mockImplementation() .mockImplementation((arg: {}) => arg) .mockImplementation((...args: string[]) => args.join("")) .mockImplementationOnce(() => "")