@@ -1030,35 +1030,22 @@ it('runs recomputeDependents on atoms in the correct order', () => {
10301030 const val2Atoms = createHistoryAtoms < string | null > ( null )
10311031
10321032 const initAtom = atom ( null , ( _get , set ) => {
1033- console . log ( ' initAtom write val2Atoms' )
10341033 // if comment out this line, the test will pass
10351034 set ( val2Atoms . resetAtom , null )
1036- console . log ( ' initAtom write val1Atoms' )
10371035 set ( val1Atoms . resetAtom , 'bar' )
10381036 } )
10391037 initAtom . debugLabel = 'initAtom'
10401038
10411039 const computedValAtom = atom ( ( get ) => {
1042- const v2Value = get ( val2Atoms . valueAtom )
1040+ get ( val2Atoms . valueAtom )
10431041 const v1Value = get ( val1Atoms . valueAtom )
1044- console . log ( ' computedValAtom read val1Atoms' , v1Value , v2Value )
10451042 return v1Value
10461043 } )
10471044 computedValAtom . debugLabel = 'computedValAtom'
10481045
1049- type Store = ReturnType < typeof createStore >
1050- function testStore ( store : Store ) {
1051- console . log ( 'sub computedValAtom ----' )
1052- store . sub ( computedValAtom , ( ) => { } )
1053- console . log ( 'set initAtom ----' )
1054- store . set ( initAtom )
1055- const result = store . get ( computedValAtom )
1056- expect ( result ) . toBe ( 'bar' )
1057- }
1058- // console.log('\n2.10.0')
1059- // testStore(createStores['2.10.0']!())
1060- // console.log('\n2.10.4')
1061- // testStore(createStores['2.10.4']!())
1062- console . log ( '\n2.11.0' )
1063- testStore ( createStore ( ) )
1046+ const store = createStore ( )
1047+ store . sub ( computedValAtom , ( ) => { } )
1048+ store . set ( initAtom )
1049+ const result = store . get ( computedValAtom )
1050+ expect ( result ) . toBe ( 'bar' )
10641051} )
0 commit comments