Skip to content

Commit c5a00aa

Browse files
authored
fix(jest-mock): added missing overload call signature (#15183)
1 parent 798d6c0 commit c5a00aa

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

packages/jest-mock/src/index.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -609,6 +609,10 @@ export class ModuleMocker {
609609
metadata: MockMetadata<T, 'function'>,
610610
restore?: () => void,
611611
): Mock<T>;
612+
private _makeComponent<T>(
613+
metadata: MockMetadata<T>,
614+
restore?: () => void,
615+
): Record<string, any>;
612616
/* eslint-enable @typescript-eslint/unified-signatures */
613617
private _makeComponent<T extends UnknownFunction>(
614618
metadata: MockMetadata<T>,
@@ -927,9 +931,6 @@ export class ModuleMocker {
927931
Record<string, any> | Array<unknown> | RegExp | T | Mock | undefined
928932
>,
929933
): Mocked<T> {
930-
// metadata not compatible but it's the same type, maybe problem with
931-
// overloading of _makeComponent and not _generateMock?
932-
// @ts-expect-error - unsure why TSC complains here?
933934
const mock = this._makeComponent(metadata);
934935
if (metadata.refID != null) {
935936
refs[metadata.refID] = mock;

0 commit comments

Comments
 (0)