MCPcopy Create free account
hub / github.com/colbymchenry/codegraph / injectExecFileSync

Function injectExecFileSync

__tests__/git-index-currency.test.ts:27–28  ·  view source on GitHub ↗
(impl: (real: typeof cp.execFileSync, ...args: any[]) => unknown)

Source from the content-addressed store, hash-verified

25const actualCp = await vi.importActual<typeof import('child_process')>('child_process');
26const actualFs = await vi.importActual<typeof import('fs')>('fs');
27const injectExecFileSync = (impl: (real: typeof cp.execFileSync, ...args: any[]) => unknown) =>
28 vi.mocked(cp.execFileSync).mockImplementation(((...args: any[]) => impl(actualCp.execFileSync, ...args)) as typeof cp.execFileSync);
29const injectReadFileSync = (impl: (real: typeof fs.readFileSync, ...args: any[]) => unknown) =>
30 vi.mocked(fs.readFileSync).mockImplementation(((...args: any[]) => impl(actualFs.readFileSync, ...args)) as typeof fs.readFileSync);
31const injectOpenSync = (impl: (real: typeof fs.openSync, ...args: any[]) => unknown) =>

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected