Skip to content

Commit 26b2fd4

Browse files
committed
Fix test
1 parent b1ee7fb commit 26b2fd4

2 files changed

Lines changed: 4 additions & 13 deletions

File tree

packages/react/src/stores/__tests__/theme-store.test.ts

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,11 @@
11
// Import from bun-test-env-dom to enable DOM environment
22
import 'bun-test-env-dom'
33

4-
import { beforeAll } from 'bun:test'
5-
import { afterAll } from 'bun:test'
64
import { describe, expect, it } from 'bun:test'
75

86
import { createServerThemeStore } from '../theme-store'
97

108
describe('themeStore ssr', () => {
11-
const originalWindow = globalThis.window
12-
beforeAll(() => {
13-
globalThis.window = undefined
14-
})
15-
16-
afterAll(() => {
17-
globalThis.window = originalWindow
18-
})
19-
209
it('should filter mutations by type and target', async () => {
2110
// const { createThemeStore } = await import('../theme-store')
2211
const themeStore = createServerThemeStore()

packages/react/src/stores/theme-store.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,14 @@ type StoreChangeEvent = (newTheme: Theme) => void
66

77
const initTheme = null
88

9-
export function createServerThemeStore() {
9+
export function createServerThemeStore(): ReturnType<
10+
typeof createClientThemeStore
11+
> {
1012
return {
1113
get: () => initTheme,
1214
set: () => {},
1315
subscribe: () => () => {},
14-
}
16+
} as unknown as ReturnType<typeof createClientThemeStore>
1517
}
1618

1719
function createClientThemeStore() {

0 commit comments

Comments
 (0)