We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 884030b commit 50f7f83Copy full SHA for 50f7f83
src/stubs.ts
@@ -64,16 +64,15 @@ export const configureStub = <TFunc extends AnyFunction>(
64
65
export const validateSpy = (maybeSpy: unknown): MockInstance => {
66
if (
67
- maybeSpy &&
68
- (typeof maybeSpy === 'function' || typeof maybeSpy === 'object') &&
+ typeof maybeSpy === 'function' &&
69
'mockImplementation' in maybeSpy &&
70
typeof maybeSpy.mockImplementation === 'function' &&
71
'getMockImplementation' in maybeSpy &&
72
typeof maybeSpy.getMockImplementation === 'function' &&
73
'getMockName' in maybeSpy &&
74
typeof maybeSpy.getMockName === 'function'
75
) {
76
- return maybeSpy as MockInstance
+ return maybeSpy as unknown as MockInstance
77
}
78
79
throw new NotAMockFunctionError(maybeSpy)
0 commit comments