MCPcopy Index your code
hub / github.com/anomalyco/opencode / renderer

Function renderer

packages/opencode/test/cli/run/theme.test.ts:22–39  ·  view source on GitHub ↗
(
  input: {
    themeMode?: "dark" | "light"
    colors?: TerminalColors
    fail?: boolean
  } = {},
)

Source from the content-addressed store, hash-verified

20}
21
22function renderer(
23 input: {
24 themeMode?: "dark" | "light"
25 colors?: TerminalColors
26 fail?: boolean
27 } = {},
28) {
29 return {
30 themeMode: input.themeMode,
31 getPalette: async () => {
32 if (input.fail) {
33 throw new Error("boom")
34 }
35
36 return input.colors ?? terminalColors()
37 },
38 } as CliRenderer
39}
40
41function expectRgba(color: unknown) {
42 expect(color).toBeInstanceOf(RGBA)

Callers 1

theme.test.tsFile · 0.85

Calls 1

terminalColorsFunction · 0.70

Tested by

no test coverage detected