Skip to content

Commit

Permalink
✅ test: update test
Browse files Browse the repository at this point in the history
  • Loading branch information
arvinxx committed Jun 15, 2023
1 parent 69fffbd commit 3d6acbf
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion tests/createStoreUpdater.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit 3d6acbf

Please sign in to comment.