Skip to content

test(useProxy): add tests for read, mutate, nested objects, multiple mutations, and 'sync' option#1208

Merged
dai-shi merged 2 commits intopmndrs:mainfrom
sukvvon:test/useProxy
Mar 7, 2026
Merged

test(useProxy): add tests for read, mutate, nested objects, multiple mutations, and 'sync' option#1208
dai-shi merged 2 commits intopmndrs:mainfrom
sukvvon:test/useProxy

Conversation

@sukvvon
Copy link
Copy Markdown
Contributor

@sukvvon sukvvon commented Mar 7, 2026

Summary

  • Add test file for useProxy hook which had 0% coverage (12.5% statements, 0% branch, 0% functions)
  • Tests cover: read/mutate with same reference, nested object updates, multiple mutations in one handler, and sync option
  • useProxy.ts coverage improved to 100% (statements, branches, functions, lines)

Check List

  • pnpm run fix for formatting and linting code and docs

@vercel
Copy link
Copy Markdown

vercel Bot commented Mar 7, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
valtio Ready Ready Preview, Comment Mar 7, 2026 7:08am

Request Review

@codesandbox-ci
Copy link
Copy Markdown

codesandbox-ci Bot commented Mar 7, 2026

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented Mar 7, 2026

More templates

npm i https://pkg.pr.new/valtio@1208

commit: d41a119

@sukvvon sukvvon changed the title test(react/utils/useProxy): add tests for 'useProxy' test(useProxy): add tests for 'useProxy' Mar 7, 2026
@sukvvon sukvvon changed the title test(useProxy): add tests for 'useProxy' test(useProxy): add tests for read, mutate, nested objects, multiple mutations, and 'sync' option Mar 7, 2026
@sukvvon sukvvon marked this pull request as draft March 7, 2026 07:01
@sukvvon sukvvon marked this pull request as ready for review March 7, 2026 07:02
Comment thread tests/useProxy.test.tsx Outdated
@@ -0,0 +1,133 @@
/* eslint-disable react-hooks/immutability */
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you add this to the specific lines? -next-line is ok.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dai-shi 👌

Copy link
Copy Markdown
Member

@dai-shi dai-shi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@dai-shi dai-shi merged commit 975fb17 into pmndrs:main Mar 7, 2026
32 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants