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

Function createMockHandlers

cli/src/utils/__tests__/block-processor.test.ts:99–142  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

97}
98
99function createMockHandlers(): {
100 handlers: BlockProcessorHandlers
101 calls: MockCallRecord[]
102} {
103 const calls: MockCallRecord[] = []
104
105 const handlers: BlockProcessorHandlers = {
106 onReasoningGroup: (blocks, startIndex) => {
107 calls.push({ handler: 'onReasoningGroup', args: [blocks, startIndex] })
108 return `reasoning-${startIndex}`
109 },
110 onImageBlock: (block, index) => {
111 calls.push({ handler: 'onImageBlock', args: [block, index] })
112 return `image-${index}`
113 },
114 onToolGroup: (blocks, startIndex, nextIndex) => {
115 calls.push({
116 handler: 'onToolGroup',
117 args: [blocks, startIndex, nextIndex],
118 })
119 return `tools-${startIndex}-${nextIndex}`
120 },
121 onImplementorGroup: (blocks, startIndex, nextIndex) => {
122 calls.push({
123 handler: 'onImplementorGroup',
124 args: [blocks, startIndex, nextIndex],
125 })
126 return `implementors-${startIndex}-${nextIndex}`
127 },
128 onAgentGroup: (blocks, startIndex, nextIndex) => {
129 calls.push({
130 handler: 'onAgentGroup',
131 args: [blocks, startIndex, nextIndex],
132 })
133 return `agents-${startIndex}-${nextIndex}`
134 },
135 onSingleBlock: (block, index) => {
136 calls.push({ handler: 'onSingleBlock', args: [block, index] })
137 return `single-${index}`
138 },
139 }
140
141 return { handlers, calls }
142}
143
144// ============================================================================
145// Tests: isReasoningTextBlock

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected