MCPcopy Create free account
hub / github.com/anomalyco/opencode / setup

Function setup

packages/app/src/context/server-session.test.ts:85–104  ·  view source on GitHub ↗
(sessions: Record<string, Session>)

Source from the content-addressed store, hash-verified

83}
84
85function setup(sessions: Record<string, Session>) {
86 const get: unknown[] = []
87 const messages: unknown[] = []
88 const client = {
89 session: {
90 get: async (input: unknown) => {
91 get.push(input)
92 const id = (input as { sessionID: string }).sessionID
93 return { data: sessions[id] }
94 },
95 messages: async (input: unknown) => {
96 messages.push(input)
97 return response()
98 },
99 diff: async () => ({ data: [] }),
100 todo: async () => ({ data: [] }),
101 },
102 } as unknown as OpencodeClient
103 return { get, messages, store: createServerSession(client) }
104}
105
106describe("server session", () => {
107 test("resolves lineage by session ID without directory", async () => {

Callers 1

Calls 3

createServerSessionFunction · 0.90
pushMethod · 0.80
responseFunction · 0.70

Tested by

no test coverage detected