Repository navigation
test(preact-query/useMutation): wait for the mutation to settle after unmount and assert that no error is logged - #12335
Conversation
… unmount and assert that no error is logged
|
|
View your CI Pipeline Execution ↗ for commit 78fdbae
☁️ Nx Cloud last updated this comment at |
🚀 Changeset Version Preview5 package(s) bumped directly, 19 bumped as dependents. 🟨 Minor bumps
🟩 Patch bumps
|
|
No actionable comments were generated in the recent review.
|
| Layer / File(s) | Summary |
|---|---|
Unmounted mutation completion packages/preact-query/src/__tests__/useMutation.test.tsx |
The test spies on console.error, waits for the mutation timer after unmounting, and asserts that no errors were logged. The expect-expect suppression was removed. |
Priority:
Estimated code review effort: 1 (Trivial) | ~5 minutes
Change: Other
Possibly related PRs
- TanStack/query#12294: Updates a test helper in the same
useMutation.test.tsxfile.
Suggested reviewers: thevedanta
Merge Risk: 
Minimal · up to 78fdb
-
This test-only change presents no actionable merge risk.
Pre-merge checks: 
4 · 
1
-
Failed checks: 1 warning Passed checks: 4 passed-
Full details: Description check
-
Explanation
The description includes the required Changes, Checklist, and Release Impact sections. It explains the motivation, confirms local testing, confirms policy compliance, and identifies the change as dev-only.
-
-
Finishing Touches: 💡 1
-
📝 Generate docstrings: 💡
-
- Commit to this branch
- Create a new PR
🧪 Generate unit tests (beta)
-
- Commit to this branch
- Create a new PR
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
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 @coderabbitai help to get the list of available commands.
size-limit report 📦
|
🎯 Changes
The test clicked
mutateand unmounted the component, then ended before the mutation (sleep(10)) settled, so it checked nothing and needed anoxlint-disable-next-line vitest/expect-expectcomment. Spy onconsole.error, advance the timers until the mutation settles, and assert that nothing is logged, then remove the comment.✅ Checklist
pnpm run test:pr, or these tests do not apply to this pull request.🚀 Release Impact
Summary by CodeRabbit