From 32b1eb5b7bf8960e182c41b62e82deb31ffedfbc Mon Sep 17 00:00:00 2001 From: David Maskasky Date: Sun, 5 Jan 2025 21:02:31 -0800 Subject: [PATCH] cleanup --- tests/vanilla/store.test.tsx | 25 ++++++------------------- 1 file changed, 6 insertions(+), 19 deletions(-) diff --git a/tests/vanilla/store.test.tsx b/tests/vanilla/store.test.tsx index 954db7afae..cee4a42e57 100644 --- a/tests/vanilla/store.test.tsx +++ b/tests/vanilla/store.test.tsx @@ -1030,35 +1030,22 @@ it('runs recomputeDependents on atoms in the correct order', () => { const val2Atoms = createHistoryAtoms(null) const initAtom = atom(null, (_get, set) => { - console.log(' initAtom write val2Atoms') // if comment out this line, the test will pass set(val2Atoms.resetAtom, null) - console.log(' initAtom write val1Atoms') set(val1Atoms.resetAtom, 'bar') }) initAtom.debugLabel = 'initAtom' const computedValAtom = atom((get) => { - const v2Value = get(val2Atoms.valueAtom) + get(val2Atoms.valueAtom) const v1Value = get(val1Atoms.valueAtom) - console.log(' computedValAtom read val1Atoms', v1Value, v2Value) return v1Value }) computedValAtom.debugLabel = 'computedValAtom' - type Store = ReturnType - function testStore(store: Store) { - console.log('sub computedValAtom ----') - store.sub(computedValAtom, () => {}) - console.log('set initAtom ----') - store.set(initAtom) - const result = store.get(computedValAtom) - expect(result).toBe('bar') - } - // console.log('\n2.10.0') - // testStore(createStores['2.10.0']!()) - // console.log('\n2.10.4') - // testStore(createStores['2.10.4']!()) - console.log('\n2.11.0') - testStore(createStore()) + const store = createStore() + store.sub(computedValAtom, () => {}) + store.set(initAtom) + const result = store.get(computedValAtom) + expect(result).toBe('bar') })