11import { describe , expect , test } from 'bun:test' ;
2- import { store , subscribe } from '../core/core' ;
2+ import { createClassyStore , subscribe } from '../core/core' ;
33import { snapshot } from '../snapshot/snapshot' ;
44import { reactiveMap , reactiveSet } from './collections' ;
55
@@ -87,7 +87,7 @@ describe('reactiveMap()', () => {
8787 } ) ;
8888
8989 test ( 'triggers store subscription on set' , async ( ) => {
90- const s = store ( { users : reactiveMap < string , string > ( ) } ) ;
90+ const s = createClassyStore ( { users : reactiveMap < string , string > ( ) } ) ;
9191 let count = 0 ;
9292 subscribe ( s , ( ) => count ++ ) ;
9393
@@ -98,7 +98,7 @@ describe('reactiveMap()', () => {
9898 } ) ;
9999
100100 test ( 'triggers store subscription on delete' , async ( ) => {
101- const s = store ( {
101+ const s = createClassyStore ( {
102102 users : reactiveMap ( [ [ 'id1' , 'Alice' ] ] as [ string , string ] [ ] ) ,
103103 } ) ;
104104 let count = 0 ;
@@ -111,7 +111,7 @@ describe('reactiveMap()', () => {
111111 } ) ;
112112
113113 test ( 'triggers store subscription on clear' , async ( ) => {
114- const s = store ( {
114+ const s = createClassyStore ( {
115115 users : reactiveMap ( [
116116 [ 'a' , 1 ] ,
117117 [ 'b' , 2 ] ,
@@ -127,7 +127,9 @@ describe('reactiveMap()', () => {
127127 } ) ;
128128
129129 test ( 'snapshot captures map data' , async ( ) => {
130- const s = store ( { m : reactiveMap ( [ [ 'k' , 'v' ] ] as [ string , string ] [ ] ) } ) ;
130+ const s = createClassyStore ( {
131+ m : reactiveMap ( [ [ 'k' , 'v' ] ] as [ string , string ] [ ] ) ,
132+ } ) ;
131133 const snap = snapshot ( s ) ;
132134 expect ( snap . m . _entries ) . toEqual ( [ [ 'k' , 'v' ] ] ) ;
133135 // Snapshot is frozen
@@ -188,7 +190,7 @@ describe('reactiveSet()', () => {
188190 } ) ;
189191
190192 test ( 'triggers store subscription on add' , async ( ) => {
191- const s = store ( { tags : reactiveSet < string > ( ) } ) ;
193+ const s = createClassyStore ( { tags : reactiveSet < string > ( ) } ) ;
192194 let count = 0 ;
193195 subscribe ( s , ( ) => count ++ ) ;
194196
@@ -199,7 +201,7 @@ describe('reactiveSet()', () => {
199201 } ) ;
200202
201203 test ( 'triggers store subscription on delete' , async ( ) => {
202- const s = store ( { tags : reactiveSet ( [ 'a' , 'b' ] ) } ) ;
204+ const s = createClassyStore ( { tags : reactiveSet ( [ 'a' , 'b' ] ) } ) ;
203205 let count = 0 ;
204206 subscribe ( s , ( ) => count ++ ) ;
205207
@@ -210,7 +212,7 @@ describe('reactiveSet()', () => {
210212 } ) ;
211213
212214 test ( 'triggers store subscription on clear' , async ( ) => {
213- const s = store ( { tags : reactiveSet ( [ 'a' , 'b' ] ) } ) ;
215+ const s = createClassyStore ( { tags : reactiveSet ( [ 'a' , 'b' ] ) } ) ;
214216 let count = 0 ;
215217 subscribe ( s , ( ) => count ++ ) ;
216218
@@ -221,7 +223,7 @@ describe('reactiveSet()', () => {
221223 } ) ;
222224
223225 test ( 'snapshot captures set data' , async ( ) => {
224- const s = store ( { t : reactiveSet ( [ 1 , 2 , 3 ] ) } ) ;
226+ const s = createClassyStore ( { t : reactiveSet ( [ 1 , 2 , 3 ] ) } ) ;
225227 const snap = snapshot ( s ) ;
226228 expect ( snap . t . _items ) . toEqual ( [ 1 , 2 , 3 ] ) ;
227229 expect ( Object . isFrozen ( snap . t ) ) . toBe ( true ) ;
@@ -245,7 +247,7 @@ describe('collections inside class store', () => {
245247 }
246248
247249 test ( 'class methods mutate collections reactively' , async ( ) => {
248- const s = store ( new ProjectStore ( ) ) ;
250+ const s = createClassyStore ( new ProjectStore ( ) ) ;
249251 let count = 0 ;
250252 subscribe ( s , ( ) => count ++ ) ;
251253
0 commit comments