MCPcopy
hub / github.com/coder/mux / createMockExecResult

Function createMockExecResult

src/node/worktree/removeManagedGitWorktree.test.ts:13–25  ·  view source on GitHub ↗
(
  result: Promise<{ stdout: string; stderr: string }>
)

Source from the content-addressed store, hash-verified

11const noop = () => {};
12
13function createMockExecResult(
14 result: Promise<{ stdout: string; stderr: string }>
15): ReturnType<typeof disposableExec.execFileAsync> {
16 void result.catch(noop);
17 return {
18 result,
19 get promise() {
20 return result;
21 },
22 child: {},
23 [Symbol.dispose]: noop,
24 } as unknown as ReturnType<typeof disposableExec.execFileAsync>;
25}
26
27async function pathExists(targetPath: string): Promise<boolean> {
28 return fs.promises

Calls

no outgoing calls

Tested by

no test coverage detected