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

Function processWithOutput

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

Source from the content-addressed store, hash-verified

66] as const;
67
68function processWithOutput(stdout: string, stderr = '', exitCode = 0): KaosProcess {
69 const stdoutStream = Readable.from([stdout]);
70 const stderrStream = Readable.from([stderr]);
71 return {
72 stdin: { end: vi.fn(), write: vi.fn() } as unknown as Writable,
73 stdout: stdoutStream,
74 stderr: stderrStream,
75 pid: 123,
76 exitCode,
77 wait: vi.fn().mockResolvedValue(exitCode),
78 kill: vi.fn(async () => {}),
79 dispose: vi.fn(async () => {
80 stdoutStream.destroy();
81 stderrStream.destroy();
82 }),
83 };
84}
85
86function statResult(mtime: number): StatResult {
87 return {

Callers 1

grep.test.tsFile · 0.70

Calls 1

destroyMethod · 0.80

Tested by

no test coverage detected