MCPcopy Index your code
hub / github.com/CodebuffAI/codebuff / createMockParams

Function createMockParams

cli/src/commands/__tests__/command-args.test.ts:20–45  ·  view source on GitHub ↗
(
    overrides: Partial<RouterParams> = {},
  )

Source from the content-addressed store, hash-verified

18 */
19describe('command factory pattern', () => {
20 const createMockParams = (
21 overrides: Partial<RouterParams> = {},
22 ): RouterParams =>
23 ({
24 abortControllerRef: { current: null },
25 agentMode: 'DEFAULT',
26 inputRef: { current: null },
27 inputValue: '/test',
28 isChainInProgressRef: { current: false },
29 isStreaming: false,
30 logoutMutation: {} as RouterParams['logoutMutation'],
31 streamMessageIdRef: { current: null },
32 addToQueue: mock(() => {}),
33 clearMessages: mock(() => {}),
34 saveToHistory: mock(() => {}),
35 scrollToLatest: mock(() => {}),
36 sendMessage: mock(async () => {}),
37 setCanProcessQueue: mock(() => {}),
38 setInputFocused: mock(() => {}),
39 setInputValue: mock(() => {}),
40 setIsAuthenticated: mock(() => {}),
41 setMessages: mock(() => {}),
42 setUser: mock(() => {}),
43 stopStreaming: mock(() => {}),
44 ...overrides,
45 }) as RouterParams
46
47 describe('defineCommand (gracefully ignores args)', () => {
48 test('calls handler when no args provided', () => {

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected