test({react,preact}-query/useMutation): split 'should pass meta to mutation' into separate success and error tests#10947
Conversation
…tation' into separate success and error tests
|
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 (2)
📝 WalkthroughWalkthroughThe single combined ChangesuseMutation Meta Test Refactor
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~5 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
|
View your CI Pipeline Execution ↗ for commit 212d0c1
☁️ 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
The
should pass meta to mutationtest bundled two independent scenarios into one block: it set up two separateuseMutationcalls (one resolving, one rejecting) in a single component and asserted both the success-meta and error-meta paths together. These are unrelated behaviors, so each is split into its own focused test.should pass meta to mutation on success(only the resolving mutation +onSuccesscache callback) andshould pass meta to mutation on error(only the rejecting mutation +onErrorcache callback).react-queryandpreact-query, whoseuseMutationtests are kept in sync.No assertions are lost — each new test keeps the exact expectations for its path. Both packages'
useMutationsuites pass.✅ Checklist
pnpm run test:pr.🚀 Release Impact
Summary by CodeRabbit
metaparameters are correctly passed to the corresponding mutation callbacks. Improved test clarity and maintainability.