@@ -41,10 +41,9 @@ describe.each([
4141 globalThis . window = originalWindow
4242 } )
4343 if ( _isBrowser ) {
44- it ( 'should return themeStore object for browser' , async ( ) => {
44+ it ( 'should return themeStore object for browser' , ( ) => {
4545 // const modulePath = require.resolve('../theme-store')
4646 // delete require.cache[modulePath]
47- const { createThemeStore } = await import ( '../theme-store' )
4847 const themeStore = createThemeStore ( )
4948 expect ( themeStore ) . toBeDefined ( )
5049 expect ( themeStore . get ) . toEqual ( expect . any ( Function ) )
@@ -59,10 +58,9 @@ describe.each([
5958 expect ( themeStore . set ( 'dark' as any ) ) . toBeUndefined ( )
6059 } )
6160
62- it ( 'should call subscriber when theme changes via set' , async ( ) => {
61+ it ( 'should call subscriber when theme changes via set' , ( ) => {
6362 // const modulePath = require.resolve('../theme-store')
6463 // delete require.cache[modulePath]
65- const { createThemeStore } = await import ( '../theme-store' )
6664 const themeStore = createThemeStore ( )
6765 const callback = mock ( )
6866
@@ -77,10 +75,9 @@ describe.each([
7775 expect ( themeStore . get ( ) ) . toBe ( 'light' as any )
7876 } )
7977
80- it ( 'should unsubscribe correctly' , async ( ) => {
78+ it ( 'should unsubscribe correctly' , ( ) => {
8179 // const modulePath = require.resolve('../theme-store')
8280 // delete require.cache[modulePath]
83- const { createThemeStore } = await import ( '../theme-store' )
8481 const themeStore = createThemeStore ( )
8582 const callback = mock ( )
8683
@@ -96,12 +93,11 @@ describe.each([
9693 expect ( callback ) . toHaveBeenCalledTimes ( 1 )
9794 } )
9895
99- it ( 'should read initial theme from data-theme attribute' , async ( ) => {
96+ it ( 'should read initial theme from data-theme attribute' , ( ) => {
10097 document . documentElement . setAttribute ( 'data-theme' , 'dark' )
10198
10299 // const modulePath = require.resolve('../theme-store')
103100 // delete require.cache[modulePath]
104- const { createThemeStore } = await import ( '../theme-store' )
105101 const themeStore = createThemeStore ( )
106102 const callback = mock ( )
107103
@@ -114,7 +110,6 @@ describe.each([
114110 it ( 'should update theme when data-theme attribute changes via MutationObserver' , async ( ) => {
115111 // const modulePath = require.resolve('../theme-store')
116112 // delete require.cache[modulePath]
117- const { createThemeStore } = await import ( '../theme-store' )
118113 const themeStore = createThemeStore ( )
119114 const callback = mock ( )
120115
@@ -134,7 +129,6 @@ describe.each([
134129 it ( 'should handle multiple subscribers' , async ( ) => {
135130 // const modulePath = require.resolve('../theme-store')
136131 // delete require.cache[modulePath]
137- const { createThemeStore } = await import ( '../theme-store' )
138132 const themeStore = createThemeStore ( )
139133 const callback1 = mock ( )
140134 const callback2 = mock ( )
@@ -151,7 +145,6 @@ describe.each([
151145 it ( 'should filter mutations by type and target' , async ( ) => {
152146 // const modulePath = require.resolve('../theme-store')
153147 // delete require.cache[modulePath]
154- const { createThemeStore } = await import ( '../theme-store' )
155148 const themeStore = createThemeStore ( )
156149 const callback = mock ( )
157150
0 commit comments