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

Function mockLlmCall

common/src/util/__tests__/error-abort.test.ts:302–307  ·  view source on GitHub ↗
(shouldAbort: boolean)

Source from the content-addressed store, hash-verified

300describe('PromptResult integration patterns', () => {
301 describe('early return pattern', () => {
302 async function mockLlmCall(shouldAbort: boolean): Promise<PromptResult<string>> {
303 if (shouldAbort) {
304 return promptAborted('User cancelled')
305 }
306 return promptSuccess('LLM response')
307 }
308
309 async function callerWithEarlyReturn(shouldAbort: boolean): Promise<string | null> {
310 const result = await mockLlmCall(shouldAbort)

Callers 2

callerWithEarlyReturnFunction · 0.85
callerWithUnwrapFunction · 0.85

Calls 2

promptAbortedFunction · 0.90
promptSuccessFunction · 0.90

Tested by

no test coverage detected