File tree Expand file tree Collapse file tree
packages/react/src/stores Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11// Import from bun-test-env-dom to enable DOM environment
22import 'bun-test-env-dom'
33
4- import { beforeAll } from 'bun:test'
5- import { afterAll } from 'bun:test'
64import { describe , expect , it } from 'bun:test'
75
86import { createServerThemeStore } from '../theme-store'
97
108describe ( '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 ( )
Original file line number Diff line number Diff line change @@ -6,12 +6,14 @@ type StoreChangeEvent = (newTheme: Theme) => void
66
77const 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
1719function createClientThemeStore ( ) {
You can’t perform that action at this time.
0 commit comments