test({react,preact,svelte}-query/queryOptions): remove dead 'QueriesObserver' type tests duplicated by 'query-core' - #11572
Conversation
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. 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 (3)
Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review. 📝 WalkthroughWalkthroughThe PR removes ChangesQuery option type-test cleanup
Priority: ⬇️ Low Estimated code review effort: 1 (Trivial) | ~5 minutes Change: Other Suggested reviewers: Merge Risk: ⚪ Minimal · up to This removes redundant QueriesObserver type tests and unused imports; published behavior is unchanged, so the PR is ready to merge. 🚥 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 |
|
View your CI Pipeline Execution ↗ for commit bf484be
☁️ 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 📦
|
…bserver' type tests duplicated by 'query-core'
bf484be to
7b0f2e6
Compare
🎯 Changes
queryOptions.test-dinreact-query,preact-query, andsvelte-queryeach had a'should return the proper type when passed to QueriesObserver'case:This asserted nothing.
QueriesObserver's constructor takesqueries: Array<QueryObserverOptions<any, any, any, any, any>>— fiveanys — so passing a realqueryOptions()result vs. a plain object makes no difference to inference.TCombinedResultis only decided by the third constructor argument (options.combine), which none of these tests passed, so the assertion always resolved to the defaultArray<QueryObserverResult>: a tautology that can't fail from a regression.QueriesObserveris aquery-coreclass; its type behavior belongs inquery-core's own tests, not scattered across adapterqueryOptions.test-dfiles.query-corenow hasqueriesObserver.test-d.tsx, including a case that passescombineand asserts the inferredTCombinedResultactually changes — a real, breakable check. That makes these three copies redundant as well as dead.Removed the three
itblocks and the now-unusedQueriesObserver/QueryObserverResultimports.solid-queryandvue-querynever had this case, andangular-query-experimental/lit-queryhave noqueryOptions.test-dfile, so no other adapter needs the same cleanup.✅ Checklist
pnpm run test:pr, or these tests do not apply to this pull request.🚀 Release Impact
Summary by CodeRabbit
QueriesObservertype-inference coverage while retaining the remainingqueryOptionstests.