Skip to content

Commit 1f19e71

Browse files
committed
test(themes): add tests to cover themes.ts
1 parent 546e120 commit 1f19e71

2 files changed

Lines changed: 23 additions & 1 deletion

File tree

.husky/pre-commit

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
#!/usr/bin/env sh
22
. "$(dirname -- "$0")/_/husky.sh"
33

4-
npx lint-staged
4+
npx lint-staged -q

test/themes.test.ts

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
import { describe, expect, it } from "vitest";
2+
import { themes, getThemeByName } from "../src/cards/themes";
3+
4+
describe("Themes", () => {
5+
it("should return the darcula theme", () => {
6+
expect(getThemeByName("darcula")).toEqual(themes.get("darcula"));
7+
});
8+
9+
it("should return the github_dark theme", () => {
10+
expect(getThemeByName("github_dark")).toEqual(themes.get("github_dark"));
11+
});
12+
13+
it("should return the material theme", () => {
14+
expect(getThemeByName("material")).toEqual(themes.get("material"));
15+
});
16+
17+
it("should return the github theme (since it's the default)", () => {
18+
expect(getThemeByName("themeWithThisNameDoesNotExist")).toEqual(
19+
themes.get("github")
20+
);
21+
});
22+
});

0 commit comments

Comments
 (0)