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

Function fakeProcess

apps/kimi-code/test/cli/run-prompt.test.ts:157–171  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

155}
156
157function fakeProcess() {
158 const listeners = new Map<NodeJS.Signals, () => Promise<void> | void>();
159 return {
160 once: vi.fn((signal: NodeJS.Signals, listener: () => Promise<void> | void) => {
161 listeners.set(signal, listener);
162 }),
163 off: vi.fn((signal: NodeJS.Signals, listener: () => Promise<void> | void) => {
164 if (listeners.get(signal) === listener) {
165 listeners.delete(signal);
166 }
167 }),
168 exit: vi.fn(),
169 listener: (signal: NodeJS.Signals) => listeners.get(signal),
170 };
171}
172
173async function waitForAssertion(assertion: () => void): Promise<void> {
174 let lastError: unknown;

Callers 1

run-prompt.test.tsFile · 0.70

Calls 3

setMethod · 0.65
getMethod · 0.65
deleteMethod · 0.65

Tested by

no test coverage detected