Skip to content

Commit

Permalink
test(withAtomEffect): add case for writable setStateAction
Browse files Browse the repository at this point in the history
  • Loading branch information
David Maskasky committed Sep 6, 2024
1 parent c42b21e commit edc2f4a
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions __tests__/withAtomEffect.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ describe('withAtomEffect', () => {
store.sub(enhancedAtom, () => {})
store.set(enhancedAtom, 5)
expect(store.get(enhancedAtom)).toBe(5)
store.set(enhancedAtom, (prev) => prev + 1)
expect(store.get(enhancedAtom)).toBe(6)
})

it('calls effect on initial use and on dependencies change', async () => {
Expand Down

0 comments on commit edc2f4a

Please sign in to comment.