Skip to content
Source
Sign inSign up
pingdotgg/t3code
Open History to see the last commit

terminalTheme.test.ts

36 lines1.2 KB

1import { describe, expect, it } from "vite-plus/test";
2​
3import { buildGhosttyThemeConfig, getPierreTerminalTheme } from "./terminalTheme";
4​
5describe("getPierreTerminalTheme", () => {
6 it("returns the Pierre light terminal palette", () => {
7 expect(getPierreTerminalTheme("light")).toMatchObject({
8 background: "#f2f2f7",
9 foreground: "#6C6C71",
10 cursorForeground: "#009fff",
11 cursorBackground: "#f2f2f7",
12 });
13 });
14​
15 it("returns the Pierre dark terminal palette", () => {
16 expect(getPierreTerminalTheme("dark")).toMatchObject({
17 background: "#0a0a0a",
18 foreground: "#adadb1",
19 cursorForeground: "#009fff",
20 cursorBackground: "#0a0a0a",
21 });
22 });
23});
24​
25describe("buildGhosttyThemeConfig", () => {
26 it("serializes theme colors into a ghostty config file", () => {
27 const config = buildGhosttyThemeConfig(getPierreTerminalTheme("dark"));
28​
29 expect(config).toContain("background = #0a0a0a");
30 expect(config).toContain("foreground = #adadb1");
31 expect(config).toContain("cursor-color = #009fff");
32 expect(config).toContain("palette = 0=#141415");
33 expect(config).toContain("palette = 15=#c6c6c8");
34 expect(config.endsWith("\n")).toBe(true);
35 });
36});