From ce19c16e0d2f9254912ebd5c1c33984ea51b2b3d Mon Sep 17 00:00:00 2001 From: Eric Crooks Date: Sat, 10 Dec 2022 11:13:06 -0500 Subject: [PATCH] fix: OriginalObject not assignable to type object --- src/fake/fake_mixin.ts | 2 +- src/mock/mock_mixin.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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.`,