mirror of
https://github.com/chriswritescode-dev/opencode-manager.git
synced 2026-12-05 20:34:18 +01:00
17 lines
797 B
TypeScript
17 lines
797 B
TypeScript
import { vi } from 'vitest'
|
|
import type { OpenCodeClient } from '../../src/services/opencode/client'
|
|
|
|
export function createStubOpenCodeClient(overrides: Partial<OpenCodeClient> = {}): OpenCodeClient {
|
|
return {
|
|
forward: vi.fn(async () => new Response(JSON.stringify({}), { status: 200 })),
|
|
forwardRaw: vi.fn(async () => new Response(JSON.stringify({}), { status: 200 })),
|
|
getJson: vi.fn(async () => ({}) as unknown),
|
|
postJson: vi.fn(async () => ({}) as unknown),
|
|
setProviderAuth: vi.fn(async () => true),
|
|
deleteProviderAuth: vi.fn(async () => true),
|
|
startMcpAuth: vi.fn(async () => new Response(JSON.stringify({}), { status: 200 })),
|
|
authenticateMcp: vi.fn(async () => new Response(JSON.stringify({}), { status: 200 })),
|
|
...overrides,
|
|
} as OpenCodeClient
|
|
}
|