Skip to content

test({react,preact,svelte}-query/queryOptions): remove dead 'QueriesObserver' type tests duplicated by 'query-core' - #11572

Merged
sukvvon merged 1 commit into
mainfrom
test/remove-dead-queriesobserver-type-tests
Sep 22, 2026
Merged

sukvvon merged 1 commit into
mainfrom
test/remove-dead-queriesobserver-type-tests

Conversation

@sukvvon

@sukvvon sukvvon commented Sep 22, 2026 •

Copy link
Copy Markdown
Member

🎯 Changes

queryOptions.test-d in react-query, preact-query, and svelte-query each had a 'should return the proper type when passed to QueriesObserver' case:

const queriesObserver = new QueriesObserver(queryClient, [options])
expectTypeOf(queriesObserver).toEqualTypeOf<
  QueriesObserver<Array<QueryObserverResult>>
>()

This asserted nothing. QueriesObserver's constructor takes queries: Array<QueryObserverOptions<any, any, any, any, any>> — five anys — so passing a real queryOptions() result vs. a plain object makes no difference to inference. TCombinedResult is only decided by the third constructor argument (options.combine), which none of these tests passed, so the assertion always resolved to the default Array<QueryObserverResult>: a tautology that can't fail from a regression.

QueriesObserver is a query-core class; its type behavior belongs in query-core's own tests, not scattered across adapter queryOptions.test-d files. query-core now has queriesObserver.test-d.tsx, including a case that passes combine and asserts the inferred TCombinedResult actually changes — a real, breakable check. That makes these three copies redundant as well as dead.

Removed the three it blocks and the now-unused QueriesObserver/QueryObserverResult imports. solid-query and vue-query never had this case, and angular-query-experimental/lit-query have no queryOptions.test-d file, so no other adapter needs the same cleanup.

✅ Checklist

  • I have followed the steps in the Contributing guide.
  • I have tested code changes locally with pnpm run test:pr, or these tests do not apply to this pull request.
  • I fully understand the code in this pull request, including any code generated with AI assistance.

🚀 Release Impact

  • This change affects published code, and I have generated a changeset.
  • This change is docs/CI/dev-only (no release).

Summary by CodeRabbit

  • Tests
    • Simplified type-level test imports across Preact, React, and Svelte integrations.
    • Removed obsolete QueriesObserver type-inference coverage while retaining the remaining queryOptions tests.

@coderabbitai

coderabbitai Bot commented Sep 22, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

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 configuration

Configuration used: Repository: TanStack/query/.coderabbit.yaml

Review profile: CHILL

Plan: Advanced

Run ID: 31966936-203c-4c3b-99ea-49b46a6840c8

📥 Commits

Reviewing files that changed from the base of the PR and between baf7cc6 and bf484be.

📒 Files selected for processing (3)
  • packages/preact-query/src/__tests__/queryOptions.test-d.tsx
  • packages/react-query/src/__tests__/queryOptions.test-d.tsx
  • packages/svelte-query/tests/queryOptions.test-d.ts

Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review.


📝 Walkthrough

Walkthrough

The PR removes QueriesObserver type-inference tests and their unused imports from the Preact, React, and Svelte query option type-test files.

Changes

Query option type-test cleanup

Layer / File(s) Summary
Remove QueriesObserver test coverage
packages/preact-query/src/__tests__/queryOptions.test-d.tsx, packages/react-query/src/__tests__/queryOptions.test-d.tsx, packages/svelte-query/tests/queryOptions.test-d.ts
The three type-test files remove QueriesObserver and QueryObserverResult imports and delete the related type-inference tests.

Priority: ⬇️ Low

Estimated code review effort: 1 (Trivial) | ~5 minutes

Change: Other

Suggested reviewers: dogpawhat

Merge Risk: ⚪ Minimal · up to bf484

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)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 3…
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title clearly identifies the affected query adapters and the removal of redundant QueriesObserver type tests. It accurately summarizes the main change.
Description check ✅ Passed The description explains the motivation, technical details, affected packages, test coverage, checklist status, and release impact. It follows the required template.
✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@sukvvon sukvvon self-assigned this Sep 22, 2026
@nx-cloud

nx-cloud Bot commented Sep 22, 2026 •

Copy link
Copy Markdown

View your CI Pipeline Execution ↗ for commit bf484be

Command Status Duration Result
nx affected --targets=test:sherif,test:knip,tes... ✅ Succeeded 2m 53s View ↗
nx run-many --target=build --exclude=examples/*... ✅ Succeeded 1s View ↗

☁️ Nx Cloud last updated this comment at 2026-09-22 05:04:27 UTC

@github-actions

Copy link
Copy Markdown
Contributor

🚀 Changeset Version Preview

No changeset entries found. Merging this PR will not cause a version bump for any packages.

@pkg-pr-new

pkg-pr-new Bot commented Sep 22, 2026 •

Copy link
Copy Markdown
More templates

@tanstack/angular-query-experimental

npm i https://pkg.pr.new/@tanstack/angular-query-experimental@11572

@tanstack/eslint-plugin-query

npm i https://pkg.pr.new/@tanstack/eslint-plugin-query@11572

@tanstack/lit-query

npm i https://pkg.pr.new/@tanstack/lit-query@11572

@tanstack/preact-query

npm i https://pkg.pr.new/@tanstack/preact-query@11572

@tanstack/preact-query-devtools

npm i https://pkg.pr.new/@tanstack/preact-query-devtools@11572

@tanstack/preact-query-persist-client

npm i https://pkg.pr.new/@tanstack/preact-query-persist-client@11572

@tanstack/query-async-storage-persister

npm i https://pkg.pr.new/@tanstack/query-async-storage-persister@11572

@tanstack/query-broadcast-client-experimental

npm i https://pkg.pr.new/@tanstack/query-broadcast-client-experimental@11572

@tanstack/query-core

npm i https://pkg.pr.new/@tanstack/query-core@11572

@tanstack/query-devtools

npm i https://pkg.pr.new/@tanstack/query-devtools@11572

@tanstack/query-persist-client-core

npm i https://pkg.pr.new/@tanstack/query-persist-client-core@11572

@tanstack/query-sync-storage-persister

npm i https://pkg.pr.new/@tanstack/query-sync-storage-persister@11572

@tanstack/react-query

npm i https://pkg.pr.new/@tanstack/react-query@11572

@tanstack/react-query-devtools

npm i https://pkg.pr.new/@tanstack/react-query-devtools@11572

@tanstack/react-query-next-experimental

npm i https://pkg.pr.new/@tanstack/react-query-next-experimental@11572

@tanstack/react-query-persist-client

npm i https://pkg.pr.new/@tanstack/react-query-persist-client@11572

@tanstack/solid-query

npm i https://pkg.pr.new/@tanstack/solid-query@11572

@tanstack/solid-query-devtools

npm i https://pkg.pr.new/@tanstack/solid-query-devtools@11572

@tanstack/solid-query-persist-client

npm i https://pkg.pr.new/@tanstack/solid-query-persist-client@11572

@tanstack/svelte-query

npm i https://pkg.pr.new/@tanstack/svelte-query@11572

@tanstack/svelte-query-devtools

npm i https://pkg.pr.new/@tanstack/svelte-query-devtools@11572

@tanstack/svelte-query-persist-client

npm i https://pkg.pr.new/@tanstack/svelte-query-persist-client@11572

@tanstack/vue-query

npm i https://pkg.pr.new/@tanstack/vue-query@11572

@tanstack/vue-query-devtools

npm i https://pkg.pr.new/@tanstack/vue-query-devtools@11572

commit: 7b0f2e6

@github-actions

Copy link
Copy Markdown
Contributor

size-limit report 📦

Path Size
react full 11.87 KB (0%)
react minimal 8.85 KB (0%)

…bserver' type tests duplicated by 'query-core'
@sukvvon
sukvvon force-pushed the test/remove-dead-queriesobserver-type-tests branch from bf484be to 7b0f2e6 Compare September 22, 2026 05:00
@sukvvon sukvvon changed the title test({react,preact,svelte}-query): remove dead 'QueriesObserver' type tests duplicated by 'query-core' test({react,preact,svelte}-query/queryOptions): remove dead 'QueriesObserver' type tests duplicated by 'query-core' Sep 22, 2026
@sukvvon
sukvvon merged commit 9b14786 into main Sep 22, 2026
9 checks passed
@sukvvon
sukvvon deleted the test/remove-dead-queriesobserver-type-tests branch September 22, 2026 05:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant