Uh oh!
There was an error while loading. Please reload this page.
test({react,preact,solid}-query/useMutation): improve callback assertions with 'toHaveBeenNthCalledWith' - #11050
Conversation
…ions with 'toHaveBeenNthCalledWith'
View your CI Pipeline Execution ↗ for commit 5eef12e
☁️ Nx Cloud last updated this comment at |
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
📝 WalkthroughWalkthroughMutation callback tests for Preact, React, and Solid now verify that success, error, and settled callbacks receive arguments in the expected invocation order across three mutation attempts. ChangesMutation callback order
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
🚀 Changeset Version PreviewNo changeset entries found. Merging this PR will not cause a version bump for any packages. |
size-limit report 📦
|
Uh oh!
There was an error while loading. Please reload this page.
🎯 Changes
Applies the same strengthening as #9630 (svelte-query) to the react/preact/solid
useMutationcallback tests. In the "multiple mutate calls" tests, the mutate button is clicked three times sequentially, soonSuccess/onSettled/onErrorfire in a deterministic order with distinct arguments (1,2,3).The assertions used order-agnostic
toHaveBeenCalledWith(1)/(2)/(3), which would still pass if the callbacks fired in the wrong order. Switching totoHaveBeenNthCalledWith(1, 1)/(2, 2)/(3, 3)pins each call to its position, matching the intent of "the correct arguments after each mutate".✅ Checklist
🚀 Release Impact
Summary by CodeRabbit