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

Function kaosWithExec

packages/agent-core/test/tools/glob.test.ts:79–81  ·  view source on GitHub ↗
(exec: Kaos['exec'], overrides: Partial<Kaos> = {})

Source from the content-addressed store, hash-verified

77// Kaos with `exec` scripted and `stat` reporting a directory — the baseline
78// for tests that run the GlobTool to completion.
79function kaosWithExec(exec: Kaos['exec'], overrides: Partial<Kaos> = {}) {
80 return createFakeKaos({ exec, stat: vi.fn().mockResolvedValue(dirStat()), ...overrides });
81}
82
83function execArgs(exec: ReturnType<typeof vi.fn>): string[] {
84 return exec.mock.calls[0] as string[];

Callers 1

glob.test.tsFile · 0.85

Calls 2

createFakeKaosFunction · 0.90
dirStatFunction · 0.85

Tested by

no test coverage detected