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

Function processWithOutput

packages/agent-core/test/tools/glob.test.ts:32–48  ·  view source on GitHub ↗
(stdout: string, stderr = '', exitCode = 0)

Source from the content-addressed store, hash-verified

30const workspace: WorkspaceConfig = { workspaceDir: '/workspace', additionalDirs: ['/extra'] };
31
32function processWithOutput(stdout: string, stderr = '', exitCode = 0): KaosProcess {
33 const stdoutStream = Readable.from([stdout]);
34 const stderrStream = Readable.from([stderr]);
35 return {
36 stdin: { end: vi.fn(), write: vi.fn() } as unknown as Writable,
37 stdout: stdoutStream,
38 stderr: stderrStream,
39 pid: 123,
40 exitCode,
41 wait: vi.fn().mockResolvedValue(exitCode),
42 kill: vi.fn(async () => {}),
43 dispose: vi.fn(async () => {
44 stdoutStream.destroy();
45 stderrStream.destroy();
46 }),
47 };
48}
49
50function dirStat(): StatResult {
51 return {

Callers 1

execReturningFunction · 0.70

Calls 1

destroyMethod · 0.80

Tested by

no test coverage detected