MCPcopy
hub / github.com/anomalyco/opencode / withFakeLlmProject

Function withFakeLlmProject

packages/opencode/test/server/httpapi-sdk.test.ts:258–274  ·  view source on GitHub ↗
(
  serverPath: ServerPath,
  options: { setup?: (dir: string) => Effect.Effect<void, E, TestServices> },
  run: (input: LlmProjectFixture) => Effect.Effect<A, E, TestScope>,
)

Source from the content-addressed store, hash-verified

256}
257
258function withFakeLlmProject<A, E>(
259 serverPath: ServerPath,
260 options: { setup?: (dir: string) => Effect.Effect<void, E, TestServices> },
261 run: (input: LlmProjectFixture) => Effect.Effect<A, E, TestScope>,
262) {
263 return Effect.gen(function* () {
264 const llm = yield* TestLLMServer
265 return yield* withProject(
266 serverPath,
267 {
268 config: testProviderConfig(llm.url),
269 setup: options.setup,
270 },
271 (input) => run({ ...input, llm }),
272 )
273 }).pipe(Effect.provide(TestLLMServer.layer))
274}
275
276function writeStandardFiles(dir: string) {
277 return FSUtil.Service.use((fs) =>

Callers 1

Calls 3

testProviderConfigFunction · 0.90
withProjectFunction · 0.70
runFunction · 0.50

Tested by

no test coverage detected