From 015d491ce75680b96bd498bb65ecab04b9097bc4 Mon Sep 17 00:00:00 2001 From: Qingqi Shi Date: Sun, 6 Dec 2020 14:54:01 +0000 Subject: [PATCH] test: update test for userStateWithHistory --- tests/useStateWithHistory.test.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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', () => {