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

Function makeHost

apps/kimi-code/test/tui/commands/web.test.ts:39–60  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

37};
38
39function makeHost() {
40 let mountedPanel: MountedPanel | null = null;
41 const host = {
42 session: { id: 'ses-1' },
43 showStatus: vi.fn(),
44 showError: vi.fn(),
45 mountEditorReplacement: vi.fn((panel: MountedPanel) => {
46 mountedPanel = panel;
47 }),
48 restoreEditor: vi.fn(),
49 setExitOpenUrl: vi.fn(),
50 stop: vi.fn(async () => {}),
51 } as unknown as SlashCommandHost & {
52 showStatus: ReturnType<typeof vi.fn>;
53 showError: ReturnType<typeof vi.fn>;
54 mountEditorReplacement: ReturnType<typeof vi.fn>;
55 restoreEditor: ReturnType<typeof vi.fn>;
56 setExitOpenUrl: ReturnType<typeof vi.fn>;
57 stop: ReturnType<typeof vi.fn>;
58 };
59 return { host, getMountedPanel: () => mountedPanel };
60}
61
62describe('web slash command', () => {
63 it('is registered as an always-available built-in', () => {

Callers 1

web.test.tsFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected