(
input: {
themeMode?: "dark" | "light"
colors?: TerminalColors
fail?: boolean
} = {},
)
| 20 | } |
| 21 | |
| 22 | function 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 | |
| 41 | function expectRgba(color: unknown) { |
| 42 | expect(color).toBeInstanceOf(RGBA) |
no test coverage detected