(currentValue: (...args: any[]) => any)
| 32 | } |
| 33 | |
| 34 | const createMock = (currentValue: (...args: any[]) => any) => { |
| 35 | if (!options.createMockInstance) { |
| 36 | throw new Error( |
| 37 | '[@vitest/mocker] `createMockInstance` is not defined. This is a Vitest error. Please open a new issue with reproduction.', |
| 38 | ) |
| 39 | } |
| 40 | const createMockInstance = options.createMockInstance |
| 41 | const prototypeMembers = currentValue.prototype |
| 42 | ? collectFunctionProperties(currentValue.prototype) |
| 43 | : [] |
| 44 | return createMockInstance({ |
| 45 | name: currentValue.name, |
| 46 | prototypeMembers, |
| 47 | originalImplementation: options.type === 'autospy' ? currentValue : undefined, |
| 48 | keepMembersImplementation: options.type === 'autospy', |
| 49 | }) |
| 50 | } |
| 51 | |
| 52 | const mockPropertiesOf = ( |
| 53 | container: Record<Key, any>, |
no test coverage detected