Skip to content

Commit 50f7f83

Browse files
committed
fixup: avoid runtime change
1 parent 884030b commit 50f7f83

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/stubs.ts

+2-3
Original file line numberDiff line numberDiff line change
@@ -64,16 +64,15 @@ export const configureStub = <TFunc extends AnyFunction>(
6464

6565
export const validateSpy = (maybeSpy: unknown): MockInstance => {
6666
if (
67-
maybeSpy &&
68-
(typeof maybeSpy === 'function' || typeof maybeSpy === 'object') &&
67+
typeof maybeSpy === 'function' &&
6968
'mockImplementation' in maybeSpy &&
7069
typeof maybeSpy.mockImplementation === 'function' &&
7170
'getMockImplementation' in maybeSpy &&
7271
typeof maybeSpy.getMockImplementation === 'function' &&
7372
'getMockName' in maybeSpy &&
7473
typeof maybeSpy.getMockName === 'function'
7574
) {
76-
return maybeSpy as MockInstance
75+
return maybeSpy as unknown as MockInstance
7776
}
7877

7978
throw new NotAMockFunctionError(maybeSpy)

0 commit comments

Comments
 (0)