From 3d6acbfe5d69964d39186f1e79cf850f90ff390a Mon Sep 17 00:00:00 2001 From: arvinxx Date: Thu, 15 Jun 2023 10:40:36 +0800 Subject: [PATCH] :white_check_mark: test: update test --- tests/createStoreUpdater.test.tsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tests/createStoreUpdater.test.tsx b/tests/createStoreUpdater.test.tsx index eef0529..e49d8de 100644 --- a/tests/createStoreUpdater.test.tsx +++ b/tests/createStoreUpdater.test.tsx @@ -40,7 +40,11 @@ describe('createStoreUpdater', () => { // 检查 setState 是否被正确调用 expect(setState).toHaveBeenCalledTimes(1); - // expect(setState).toHaveBeenCalledWith({ [key]: value }); + + expect(setState).toHaveBeenCalledWith({ foo: 'bar' }, false, { + type: '💭 useStoreUpdater / foo', + payload: 'bar', + }); // 检查返回值是否为 undefined expect(result.current).toBeUndefined();