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

Function stubDeps

packages/kaos/test/login-shell-path.test.ts:44–60  ·  view source on GitHub ↗

Build a stub deps bag; records `execFileText` invocations in `calls`.

(opts: StubOpts)

Source from the content-addressed store, hash-verified

42
43/** Build a stub deps bag; records `execFileText` invocations in `calls`. */
44function stubDeps(opts: StubOpts): { deps: LoginShellPathDeps; calls: unknown[][] } {
45 const calls: unknown[][] = [];
46 return {
47 calls,
48 deps: {
49 platform: opts.platform ?? 'darwin',
50 env: opts.env ?? { SHELL: '/bin/zsh' },
51 userShell: () => opts.userShell,
52 execFileText:
53 opts.execFileText ??
54 (async (file, args, timeoutMs) => {
55 calls.push([file, args, timeoutMs]);
56 return opts.execFileResult;
57 }),
58 },
59 };
60}
61
62describe('probeLoginShellPath', () => {
63 it('runs $SHELL -l -c /usr/bin/env and returns its PATH', async () => {

Callers 1

Calls 1

pushMethod · 0.45

Tested by

no test coverage detected