@@ -1115,35 +1115,22 @@ it('runs recomputeDependents on atoms in the correct order', async () => {
11151115 const val2Atoms = createHistoryAtoms < string | null > ( null )
11161116
11171117 const initAtom = atom ( null , ( _get , set ) => {
1118- console . log ( ' initAtom write val2Atoms' )
11191118 // if comment out this line, the test will pass
11201119 set ( val2Atoms . resetAtom , null )
1121- console . log ( ' initAtom write val1Atoms' )
11221120 set ( val1Atoms . resetAtom , 'bar' )
11231121 } )
11241122 initAtom . debugLabel = 'initAtom'
11251123
11261124 const computedValAtom = atom ( ( get ) => {
1127- const v2Value = get ( val2Atoms . valueAtom )
1125+ get ( val2Atoms . valueAtom )
11281126 const v1Value = get ( val1Atoms . valueAtom )
1129- console . log ( ' computedValAtom read val1Atoms' , v1Value , v2Value )
11301127 return v1Value
11311128 } )
11321129 computedValAtom . debugLabel = 'computedValAtom'
11331130
1134- type Store = ReturnType < typeof createStore >
1135- function testStore ( store : Store ) {
1136- console . log ( 'sub computedValAtom ----' )
1137- store . sub ( computedValAtom , ( ) => { } )
1138- console . log ( 'set initAtom ----' )
1139- store . set ( initAtom )
1140- const result = store . get ( computedValAtom )
1141- expect ( result ) . toBe ( 'bar' )
1142- }
1143- // console.log('\n2.10.0')
1144- // testStore(createStores['2.10.0']!())
1145- // console.log('\n2.10.4')
1146- // testStore(createStores['2.10.4']!())
1147- console . log ( '\n2.11.0' )
1148- testStore ( createStore ( ) )
1131+ const store = createStore ( )
1132+ store . sub ( computedValAtom , ( ) => { } )
1133+ store . set ( initAtom )
1134+ const result = store . get ( computedValAtom )
1135+ expect ( result ) . toBe ( 'bar' )
11491136} )
0 commit comments