Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
dmaskasky committed Jan 6, 2025
1 parent c985ca8 commit ba3075a
Showing 1 changed file with 6 additions and 19 deletions.
25 changes: 6 additions & 19 deletions tests/vanilla/store.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1115,35 +1115,22 @@ it('runs recomputeDependents on atoms in the correct order', async () => {
const val2Atoms = createHistoryAtoms<string | null>(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<typeof createStore>
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()

Check failure on line 1131 in tests/vanilla/store.test.tsx

View workflow job for this annotation

GitHub Actions / lint

Cannot redeclare block-scoped variable 'store'.

Check failure on line 1131 in tests/vanilla/store.test.tsx

View workflow job for this annotation

GitHub Actions / test_matrix (4.8.4)

Cannot redeclare block-scoped variable 'store'.

Check failure on line 1131 in tests/vanilla/store.test.tsx

View workflow job for this annotation

GitHub Actions / test_matrix (4.6.4)

Cannot redeclare block-scoped variable 'store'.

Check failure on line 1131 in tests/vanilla/store.test.tsx

View workflow job for this annotation

GitHub Actions / test_matrix (4.5.5)

Cannot redeclare block-scoped variable 'store'.

Check failure on line 1131 in tests/vanilla/store.test.tsx

View workflow job for this annotation

GitHub Actions / test_matrix (5.0.4)

Cannot redeclare block-scoped variable 'store'.

Check failure on line 1131 in tests/vanilla/store.test.tsx

View workflow job for this annotation

GitHub Actions / test_matrix (5.1.6)

Cannot redeclare block-scoped variable 'store'.

Check failure on line 1131 in tests/vanilla/store.test.tsx

View workflow job for this annotation

GitHub Actions / test_matrix (4.9.5)

Cannot redeclare block-scoped variable 'store'.

Check failure on line 1131 in tests/vanilla/store.test.tsx

View workflow job for this annotation

GitHub Actions / test_matrix (4.4.4)

Cannot redeclare block-scoped variable 'store'.

Check failure on line 1131 in tests/vanilla/store.test.tsx

View workflow job for this annotation

GitHub Actions / test_matrix (4.3.5)

Cannot redeclare block-scoped variable 'store'.

Check failure on line 1131 in tests/vanilla/store.test.tsx

View workflow job for this annotation

GitHub Actions / test_matrix (5.4.5)

Cannot redeclare block-scoped variable 'store'.

Check failure on line 1131 in tests/vanilla/store.test.tsx

View workflow job for this annotation

GitHub Actions / test_matrix (5.2.2)

Cannot redeclare block-scoped variable 'store'.

Check failure on line 1131 in tests/vanilla/store.test.tsx

View workflow job for this annotation

GitHub Actions / test_matrix (5.5.4)

Cannot redeclare block-scoped variable 'store'.

Check failure on line 1131 in tests/vanilla/store.test.tsx

View workflow job for this annotation

GitHub Actions / test_matrix (4.7.4)

Cannot redeclare block-scoped variable 'store'.

Check failure on line 1131 in tests/vanilla/store.test.tsx

View workflow job for this annotation

GitHub Actions / test_matrix (5.3.3)

Cannot redeclare block-scoped variable 'store'.
store.sub(computedValAtom, () => {})

Check failure on line 1132 in tests/vanilla/store.test.tsx

View workflow job for this annotation

GitHub Actions / test_matrix (3.8.3)

Cannot redeclare block-scoped variable 'store'.

Check failure on line 1132 in tests/vanilla/store.test.tsx

View workflow job for this annotation

GitHub Actions / test_matrix (4.1.5)

Cannot redeclare block-scoped variable 'store'.

Check failure on line 1132 in tests/vanilla/store.test.tsx

View workflow job for this annotation

GitHub Actions / test_matrix (4.0.5)

Cannot redeclare block-scoped variable 'store'.

Check failure on line 1132 in tests/vanilla/store.test.tsx

View workflow job for this annotation

GitHub Actions / test_matrix (4.2.3)

Cannot redeclare block-scoped variable 'store'.

Check failure on line 1132 in tests/vanilla/store.test.tsx

View workflow job for this annotation

GitHub Actions / test_matrix (3.9.7)

Cannot redeclare block-scoped variable 'store'.
store.set(initAtom)
const result = store.get(computedValAtom)
expect(result).toBe('bar')
})

0 comments on commit ba3075a

Please sign in to comment.