(env?: {
processUserInputReturn?: Awaited<
ReturnType<typeof import('./processUserInput/processUserInput.js').processUserInput>
>
})
| 7 | }) |
| 8 | |
| 9 | async function buildMockedSubmit(env?: { |
| 10 | processUserInputReturn?: Awaited< |
| 11 | ReturnType<typeof import('./processUserInput/processUserInput.js').processUserInput> |
| 12 | > |
| 13 | }): Promise<{ |
| 14 | handlePromptSubmit: typeof import('./handlePromptSubmit.js').handlePromptSubmit |
| 15 | events: string[] |
| 16 | }> { |
| 17 | const processUserInputPaths = [ |
| 18 | import.meta.resolve('./processUserInput/processUserInput.ts'), |
| 19 | import.meta.resolve('./processUserInput/processUserInput.js'), |
| 20 | ] |
| 21 | const actualProcessUserInputModule = await import( |
| 22 | import.meta.resolve('./processUserInput/processUserInput.ts') |
| 23 | ) |
| 24 | |
| 25 | for (const path of processUserInputPaths) { |
| 26 | mock.module(path, () => ({ |
| 27 | ...actualProcessUserInputModule, |
| 28 | processUserInput: async () => |
| 29 | env?.processUserInputReturn ?? { |
| 30 | messages: [], |
| 31 | shouldQuery: true, |
| 32 | allowedTools: ['Bash'], |
| 33 | model: undefined, |
| 34 | effort: undefined, |
| 35 | nextInput: undefined, |
| 36 | submitNextInput: undefined, |
| 37 | }, |
| 38 | })) |
| 39 | } |
| 40 | |
| 41 | const { handlePromptSubmit } = await import('./handlePromptSubmit.js') |
| 42 | |
| 43 | return { handlePromptSubmit, events: [] } |
| 44 | } |
| 45 | |
| 46 | let originalBashCall: BashCall |
| 47 |
no test coverage detected