test(lit-query/createMutationController): add tests for calling 'mutate' and 'mutateAsync' callbacks when the controller has no callbacks - #11760
Conversation
…te' and 'mutateAsync' callbacks when the controller has no callbacks
|
View your CI Pipeline Execution ↗ for commit ff2defd
☁️ 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. |
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. Important Review skippedReview was skipped as selected files did not have any reviewable changes. ⚙️ Run configurationConfiguration used: Repository: TanStack/query/.coderabbit.yaml Review profile: CHILL Plan: Advanced Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository: TanStack/query/.coderabbit.yaml Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (1)
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review. 📝 WalkthroughWalkthroughThe test file adds coverage for per-call ChangesPer-call mutation callback coverage
Priority: ⬇️ Low Estimated code review effort: 2 (Simple) | ~10 minutes Change: Other Merge Risk: ⚪ Minimal · up to This test-only change expands per-call mutation callback coverage. No merge-blocking risk is identified; it is mergeable after normal checks. 🚥 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 |
size-limit report 📦
|
🎯 Changes
Adds 10 tests to
createMutationController.test.tsfor callbacks passed tomutateandmutateAsyncwhen the controller options define none:onSuccess+onSettledandonError+onSettled, for bothmutateandmutateAsynconSuccess,onError, andonSettledalone, for bothmutateandmutateAsyncEach test records the callbacks in an array and asserts their order after the
sleep(10)mutation settles. The rejectedmutateAsynccalls are handled with.catch(noop).✅ Checklist
pnpm run test:pr, or these tests do not apply to this pull request.🚀 Release Impact
Summary by CodeRabbit
mutateandmutateAsync, including individual callback cases when no controller-level callbacks are configured.