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

Function runHandleMainCommand

apps/kimi-code/test/cli/main.test.ts:169–184  ·  view source on GitHub ↗
(opts: CLIOptions)

Source from the content-addressed store, hash-verified

167}
168
169async function runHandleMainCommand(opts: CLIOptions): Promise<number | null> {
170 const exitSpy = vi.spyOn(process, 'exit').mockImplementation((code?: string | number | null) => {
171 throw new ExitCalled(Number(code ?? 0));
172 });
173 try {
174 await handleMainCommand(opts, '0.0.1-alpha.2');
175 return null;
176 } catch (error) {
177 if (error instanceof ExitCalled) {
178 return error.code;
179 }
180 throw error;
181 } finally {
182 exitSpy.mockRestore();
183 }
184}
185
186async function runHandleUpgradeCommand(): Promise<number> {
187 const exitSpy = vi.spyOn(process, 'exit').mockImplementation((code?: string | number | null) => {

Callers 1

main.test.tsFile · 0.85

Calls 1

handleMainCommandFunction · 0.90

Tested by

no test coverage detected