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

Function expectErrorCode

packages/opencode/test/cli/acp/helpers.ts:70–76  ·  view source on GitHub ↗
(error: unknown, code: number)

Source from the content-addressed store, hash-verified

68}
69
70export function expectErrorCode(error: unknown, code: number) {
71 if (!error || typeof error !== "object" || !("code" in error)) {
72 expect(error).toEqual({ code })
73 return
74 }
75 expect(error.code).toBe(code)
76}
77
78export function expectSelectOption(options: SessionConfigOption[] | null | undefined, id: string) {
79 const option = selectConfigOption(options, id)

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected