MCPcopy Create free account
hub / github.com/anus-dev/ANUS / setupProcessorHook

Function setupProcessorHook

packages/cli/src/ui/hooks/slashCommandProcessor.test.ts:122–154  ·  view source on GitHub ↗
(
    builtinCommands: SlashCommand[] = [],
    fileCommands: SlashCommand[] = [],
    mcpCommands: SlashCommand[] = [],
    setIsProcessing = vi.fn(),
  )

Source from the content-addressed store, hash-verified

120 });
121
122 const setupProcessorHook = (
123 builtinCommands: SlashCommand[] = [],
124 fileCommands: SlashCommand[] = [],
125 mcpCommands: SlashCommand[] = [],
126 setIsProcessing = vi.fn(),
127 ) => {
128 mockBuiltinLoadCommands.mockResolvedValue(Object.freeze(builtinCommands));
129 mockFileLoadCommands.mockResolvedValue(Object.freeze(fileCommands));
130 mockMcpLoadCommands.mockResolvedValue(Object.freeze(mcpCommands));
131
132 const { result } = renderHook(() =>
133 useSlashCommandProcessor(
134 mockConfig,
135 mockSettings,
136 mockAddItem,
137 mockClearItems,
138 mockLoadHistory,
139 vi.fn(), // refreshStatic
140 vi.fn(), // onDebugMessage
141 mockOpenThemeDialog, // openThemeDialog
142 mockOpenAuthDialog,
143 vi.fn(), // openEditorDialog
144 vi.fn(), // toggleCorgiMode
145 mockSetQuittingMessages,
146 vi.fn(), // openPrivacyNotice
147 vi.fn(), // openSettingsDialog
148 vi.fn(), // toggleVimEnabled
149 setIsProcessing,
150 ),
151 );
152
153 return result;
154 };
155
156 describe('Initialization and Command Loading', () => {
157 it('should initialize CommandService with all required loaders', () => {

Callers 1

Calls 1

useSlashCommandProcessorFunction · 0.85

Tested by

no test coverage detected