diff --git a/src/fake/fake_mixin.ts b/src/fake/fake_mixin.ts index bdc9552..05d06f7 100644 --- a/src/fake/fake_mixin.ts +++ b/src/fake/fake_mixin.ts @@ -79,7 +79,7 @@ export function createFake( methodName, ); - if (!((methodName as string) in this.#original)) { + if (!((methodName as string) in (this.#original as Record))) { const typeSafeMethodName = String(methodName as string); throw new FakeError( diff --git a/src/mock/mock_mixin.ts b/src/mock/mock_mixin.ts index fb84cc7..fb8f716 100644 --- a/src/mock/mock_mixin.ts +++ b/src/mock/mock_mixin.ts @@ -196,7 +196,7 @@ export function createMock( methodName, ); - if (!((methodName as string) in this.#original)) { + if (!((methodName as string) in (this.#original as Record))) { const typeSafeMethodName = String(methodName); throw new MockError( `Method "${typeSafeMethodName}" does not exist.`,