MCPcopy Create free account
hub / github.com/cortexkit/magic-context / fakeOpencode

Function fakeOpencode

packages/cli/src/lib/opencode-helpers.test.ts:17–24  ·  view source on GitHub ↗
(body: string)

Source from the content-addressed store, hash-verified

15});
16
17function fakeOpencode(body: string): string {
18 const dir = mkdtempSync(join(tmpdir(), "mc-oc-bin-"));
19 tempDirs.push(dir);
20 const bin = join(dir, "opencode");
21 writeFileSync(bin, `#!/bin/sh\n${body}\n`);
22 chmodSync(bin, 0o755);
23 return bin;
24}
25
26describe.if(isPosix)("opencode helpers with a resolved binary path", () => {
27 it("getAvailableModels invokes the given absolute binary", () => {

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected