MCPcopy Create free account
hub / github.com/MoonshotAI/kimi-code / makeStubExec

Function makeStubExec

packages/server/test/svc/systemd.test.ts:32–45  ·  view source on GitHub ↗
(responses: ReadonlyArray<ExecResult>)

Source from the content-addressed store, hash-verified

30}
31
32function makeStubExec(responses: ReadonlyArray<ExecResult>) {
33 const calls: StubCall[] = [];
34 let i = 0;
35 const execSystemctl = async (
36 args: readonly string[],
37 options?: ExecOptions,
38 ): Promise<ExecResult> => {
39 calls.push({ args, options });
40 const next = responses[i] ?? { stdout: '', stderr: '', code: 0 };
41 i += 1;
42 return next;
43 };
44 return { execSystemctl, calls } as const;
45}
46
47function makeDeps(
48 responses: ReadonlyArray<ExecResult>,

Callers 1

makeDepsFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected