test(solid-query/useMutation): add tests for 'MutationFunctionContext' passed to mutationFn and callbacks - #11441
Conversation
…' passed to mutationFn and callbacks
|
View your CI Pipeline Execution ↗ for commit e0809bc
☁️ Nx Cloud last updated this comment at |
e0809bc to
0bfde39
Compare
🚀 Changeset Version Preview2 package(s) bumped directly, 23 bumped as dependents. 🟨 Minor bumps
🟩 Patch bumps
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Team Run ID: 📒 Files selected for processing (2)
Included review availability: Your plan provides up to 10 included reviews per hour; 8 remain after this review. 📝 WalkthroughWalkthroughThe changes add type-level and runtime tests for ChangesMutation context coverage
Estimated code review effort: 2 (Simple) | ~10 minutes Merge Risk: ⚪ Minimal · up to This change adds Solid Query tests for mutation callback context propagation, client access, mutation keys, and invalidation behavior without changing published runtime code. No current merge-readiness risk remains. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 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 |
size-limit report 📦
|
🎯 Changes
Adds test coverage for
MutationFunctionContext(the{ client, meta, mutationKey }object passed as the last argument tomutationFnand every mutation callback) insolid-query'suseMutation.test.tsxanduseMutation.test-d.tsx, mirroring the coverage added forreact-query/preact-queryin #11440.Runtime tests added:
onSuccessreceiving a non-undefinedonMutateResultalongsidecontextmutationFnaccessing the sameQueryClientinstance viacontext.clientcontext.mutationKeyreflecting themutationKeypassed touseMutationcontext.client.invalidateQueries()actually invalidating the cache from withinonSuccessType tests added:
contexttyped asMutationFunctionContextformutationFnand every hook-level callback, andcontext.clienttyped as@tanstack/query-core'sQueryClient(not solid-query'sQueryClientsubclass —MutationFunctionContextis non-generic)contexttyped asMutationFunctionContextfor every per-callmutateoptioncontext.mutationKeytyped asMutationKey | undefined✅ Checklist
pnpm run test:pr, or these tests do not apply to this pull request.🚀 Release Impact
Summary by CodeRabbit