11import { describe , test , expect , beforeAll , afterAll } from "bun:test"
22import { tmpdir } from "os"
33import { join } from "path"
4- import { Config } from "../../src/config/config"
4+ import { loadThemeFile } from "../../src/config/config"
55import { writeFileSync , mkdirSync , rmSync } from "fs"
66
77describe ( "Theme Loading" , ( ) => {
@@ -29,7 +29,7 @@ describe("Theme Loading", () => {
2929 const themeFile = join ( tempDir , "test-theme.jsonc" )
3030 writeFileSync ( themeFile , themeContent )
3131
32- const theme = await Config . loadThemeFile ( themeFile )
32+ const theme = await loadThemeFile ( themeFile )
3333
3434 expect ( theme . theme . primary ) . toBe ( "#ff0000" )
3535 expect ( theme . theme . secondary ) . toBe ( "#00ff00" )
@@ -47,7 +47,7 @@ describe("Theme Loading", () => {
4747 const themeFile = join ( tempDir , "test-theme.jsonc" )
4848 writeFileSync ( themeFile , themeContent )
4949
50- const theme = await Config . loadThemeFile ( themeFile )
50+ const theme = await loadThemeFile ( themeFile )
5151
5252 // Environment variable should NOT be processed in themes
5353 expect ( theme . theme . primary ) . toBe ( "{env:TEST_COLOR}" )
@@ -68,7 +68,7 @@ describe("Theme Loading", () => {
6868 const themeFile = join ( tempDir , "test-theme.jsonc" )
6969 writeFileSync ( themeFile , themeContent )
7070
71- const theme = await Config . loadThemeFile ( themeFile )
71+ const theme = await loadThemeFile ( themeFile )
7272
7373 // File inclusion should NOT be processed in themes
7474 expect ( theme . theme . primary ) . toBe ( "{file:color.txt}" )
@@ -86,7 +86,7 @@ describe("Theme Loading", () => {
8686 const themeFile = join ( tempDir , "test-theme.jsonc" )
8787 writeFileSync ( themeFile , themeContent )
8888
89- const theme = await Config . loadThemeFile ( themeFile )
89+ const theme = await loadThemeFile ( themeFile )
9090
9191 expect ( theme . theme . primary ) . toBe ( "#ff0000" )
9292 expect ( theme . theme . secondary ) . toBe ( "#00ff00" )
@@ -103,13 +103,13 @@ describe("Theme Loading", () => {
103103 const themeFile = join ( tempDir , "test-theme.jsonc" )
104104 writeFileSync ( themeFile , themeContent )
105105
106- expect ( Config . loadThemeFile ( themeFile ) ) . rejects . toThrow ( )
106+ expect ( loadThemeFile ( themeFile ) ) . rejects . toThrow ( )
107107 } )
108108
109109 test ( "should throw error for empty theme file" , async ( ) => {
110110 const themeFile = join ( tempDir , "empty-theme.jsonc" )
111111 writeFileSync ( themeFile , "" )
112112
113- expect ( Config . loadThemeFile ( themeFile ) ) . rejects . toThrow ( "Empty theme file" )
113+ expect ( loadThemeFile ( themeFile ) ) . rejects . toThrow ( "Empty theme file" )
114114 } )
115115} )
0 commit comments