Skip to content

Commit

Permalink
✅: test reset for useCounter (#570 by @luckrnx09)
Browse files Browse the repository at this point in the history
  • Loading branch information
luckrnx09 authored Apr 4, 2024
1 parent 0396d28 commit 7ba7e3a
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions packages/usehooks-ts/src/useCounter/useCounter.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,4 +68,15 @@ describe('useCounter()', () => {

expect(result.current.count).toBe(7)
})

it('should reset counter', () => {
const { result } = renderHook(() => useCounter(0))

act(() => {
result.current.increment()
result.current.reset()
})

expect(result.current.count).toBe(0)
})
})

0 comments on commit 7ba7e3a

Please sign in to comment.