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

Function runHandleUpgradeCommand

apps/kimi-code/test/cli/main.test.ts:186–201  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

184}
185
186async function runHandleUpgradeCommand(): Promise<number> {
187 const exitSpy = vi.spyOn(process, 'exit').mockImplementation((code?: string | number | null) => {
188 throw new ExitCalled(Number(code ?? 0));
189 });
190 try {
191 await handleUpgradeCommand('0.0.1-alpha.2');
192 throw new Error('expected process.exit');
193 } catch (error) {
194 if (error instanceof ExitCalled) {
195 return error.code;
196 }
197 throw error;
198 } finally {
199 exitSpy.mockRestore();
200 }
201}
202
203describe('main entry command handling', () => {
204 afterEach(() => {

Callers 1

main.test.tsFile · 0.85

Calls 1

handleUpgradeCommandFunction · 0.90

Tested by

no test coverage detected