diff --git a/tests/useStateWithHistory.test.ts b/tests/useStateWithHistory.test.ts index 4c1fc9db..f08f230d 100644 --- a/tests/useStateWithHistory.test.ts +++ b/tests/useStateWithHistory.test.ts @@ -52,9 +52,9 @@ describe('useStateWithHistory', () => { }); expect(hook.result.current[0][0]).toBe(321); act(() => { - hook.result.current[0][1](() => 111); + hook.result.current[0][1]((current) => (current ?? 0) + 111); }); - expect(hook.result.current[0][0]).toBe(111); + expect(hook.result.current[0][0]).toBe(432); }); it('should receive initial history', () => {