| 32 | const readFileMock = vi.mocked(fsPromises.readFile); |
| 33 | |
| 34 | const callExecFile = (stdout: string) => { |
| 35 | execFileMock.mockImplementationOnce(((...args: unknown[]) => { |
| 36 | const callback = [...args].reverse().find((arg) => typeof arg === 'function') as |
| 37 | | ((error: Error | null, stdout: string) => void) |
| 38 | | undefined; |
| 39 | callback?.(null, stdout); |
| 40 | return {} as childProcess.ChildProcess; |
| 41 | }) as typeof childProcess.execFile); |
| 42 | }; |
| 43 | |
| 44 | const existingPaths = (...paths: string[]) => { |
| 45 | const normalizedPaths = new Set(paths.map((filePath) => filePath.toLowerCase())); |