test(*): add adapter-level type coverage for optional undefinable mutate variables - #11257
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (6)
Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review. 📝 WalkthroughWalkthroughThe pull request adds type-level coverage across Angular, Preact, React, Solid, Svelte, and Vue mutation APIs. The tests verify that ChangesMutation callability coverage
Estimated code review effort: 2 (Simple) | ~10 minutes Merge Risk: ⚪ Minimal · up to This change adds type coverage for optional mutation variables without changing published runtime behavior. No actionable merge-blocking risk remains beyond normal checks and review. 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
View your CI Pipeline Execution ↗ for commit d9f30fe
☁️ Nx Cloud last updated this comment at |
🚀 Changeset Version PreviewNo changeset entries found. Merging this PR will not cause a version bump for any packages. |
size-limit report 📦
|
🎯 Changes
fix(query-core): make MutateFunction optional undefinable-variables (#8737)madeMutateFunction's variables parameter optional whenTVariablesincludesundefined(e.g.number | undefined), and updated themutatewrapper in every framework adapter (args[0] as TVariablescast) to match. That PR added type-level tests for the conditional type itself inquery-core/src/__tests__/mutations.test-d.tsx, but no adapter exposed an equivalent type-level check for its own exportedmutate/mutateAsyncfunction (UseMutateFunction,CreateMutateFunction, etc.).This PR adds one
.test-dcase per adapter asserting thatmutate/mutateAsynccan be called with no arguments whenTVariablesis an optional undefinable type:react-query/src/__tests__/useMutation.test-d.tsxpreact-query/src/__tests__/useMutation.test-d.tsxsolid-query/src/__tests__/useMutation.test-d.tsxsvelte-query/tests/createMutation/createMutation.test-d.tsangular-query-experimental/src/__tests__/inject-mutation.test-d.tsvue-query/src/__tests__/useMutation.test-d.tsx✅ Checklist
pnpm run test:pr.🚀 Release Impact