Skip to content

test(vue-query/useQuery): move suspense regression tests into 'useQuery.test.ts' - #11250

Merged
sukvvon merged 1 commit into
mainfrom
test/vue-query-useQuery-suspense-move
Aug 22, 2026
Merged

test(vue-query/useQuery): move suspense regression tests into 'useQuery.test.ts'#11250
sukvvon merged 1 commit into
mainfrom
test/vue-query-useQuery-suspense-move

Conversation

@sukvvon

@sukvvon sukvvon commented Aug 22, 2026

Copy link
Copy Markdown
Member

🎯 Changes

Move the two .suspense() regression tests added in #11249 from the standalone suspense.test.ts into the existing describe('suspense', ...) block in useQuery.test.ts, and delete the now-empty separate file.

This is safe because src/__mocks__/useBaseQuery.ts is vi.fn(originImpl) — a spy wrapping the real implementation, not a stub. useQuery.test.ts's vi.mock('../useBaseQuery') therefore preserves real behavior; it only enables the file's other test (should properly execute query) to assert on call arguments. The suspense tests still exercise the real fetchOptimistic code path in query-core, same as before the move.

Verified locally: reverting fetchOptimistic in packages/query-core/src/queryObserver.ts to its pre-#11036 form makes both moved tests time out, confirming they still test the real fix after relocation.

No test behavior changes — this is a file-organization move only.

✅ Checklist

  • I have followed the steps in the Contributing guide.
  • I have tested this code locally with pnpm run test:pr.

🚀 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

  • Bug Fixes

    • Improved suspense handling when query data is updated while a request is still in progress.
    • Suspense now releases correctly when the first portion of streamed query results arrives, allowing available data to display sooner.
  • Tests

    • Expanded coverage for suspense behavior with manually updated data and streamed query responses.

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

nx-cloud Bot commented Aug 22, 2026

Copy link
Copy Markdown

View your CI Pipeline Execution ↗ for commit a79d0fa

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

☁️ Nx Cloud last updated this comment at 2026-08-22 03:03:28 UTC

@github-actions

Copy link
Copy Markdown
Contributor

🚀 Changeset Version Preview

10 package(s) bumped directly, 15 bumped as dependents.

🟨 Minor bumps

Package Version Reason
@tanstack/angular-query-experimental 5.101.4 → 5.102.0 Changeset
@tanstack/eslint-plugin-query 5.101.4 → 5.102.0 Changeset
@tanstack/preact-query 5.101.4 → 5.102.0 Changeset
@tanstack/query-broadcast-client-experimental 5.101.4 → 5.102.0 Changeset
@tanstack/query-core 5.101.4 → 5.102.0 Changeset
@tanstack/react-query 5.101.4 → 5.102.0 Changeset
@tanstack/solid-query 5.101.4 → 5.102.0 Changeset
@tanstack/vue-query 5.101.4 → 5.102.0 Changeset
@tanstack/angular-query-persist-client 5.101.4 → 5.102.0 Dependent
@tanstack/preact-query-devtools 5.101.4 → 5.102.0 Dependent
@tanstack/preact-query-persist-client 5.101.4 → 5.102.0 Dependent
@tanstack/query-async-storage-persister 5.101.4 → 5.102.0 Dependent
@tanstack/query-devtools 5.101.4 → 5.102.0 Dependent
@tanstack/query-persist-client-core 5.101.4 → 5.102.0 Dependent
@tanstack/query-sync-storage-persister 5.101.4 → 5.102.0 Dependent
@tanstack/react-query-devtools 5.101.4 → 5.102.0 Dependent
@tanstack/react-query-next-experimental 5.101.4 → 5.102.0 Dependent
@tanstack/react-query-persist-client 5.101.4 → 5.102.0 Dependent
@tanstack/solid-query-devtools 5.101.4 → 5.102.0 Dependent
@tanstack/solid-query-persist-client 5.101.4 → 5.102.0 Dependent

🟩 Patch bumps

Package Version Reason
@tanstack/lit-query 0.2.11 → 0.2.12 Changeset
@tanstack/svelte-query 6.1.38 → 6.1.39 Changeset
@tanstack/svelte-query-devtools 6.1.38 → 6.1.39 Dependent
@tanstack/svelte-query-persist-client 6.1.38 → 6.1.39 Dependent
@tanstack/vue-query-devtools 6.1.38 → 6.1.39 Dependent

@coderabbitai

coderabbitai Bot commented Aug 22, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 5cb07bbb-5479-48b7-b6c6-d9440dc22890

📥 Commits

Reviewing files that changed from the base of the PR and between eeb9820 and a79d0fa.

📒 Files selected for processing (2)
  • packages/vue-query/src/__tests__/suspense.test.ts
  • packages/vue-query/src/__tests__/useQuery.test.ts
💤 Files with no reviewable changes (1)
  • packages/vue-query/src/tests/suspense.test.ts

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


📝 Walkthrough

Walkthrough

Suspense tests moved from suspense.test.ts into useQuery.test.ts. The tests cover manual setQueryData updates during an in-flight fetch and resolution after the first experimental_streamedQuery chunk.

Changes

Vue Query suspense coverage

Layer / File(s) Summary
Suspense resolution tests
packages/vue-query/src/__tests__/useQuery.test.ts, packages/vue-query/src/__tests__/suspense.test.ts
useQuery.test.ts imports the required query APIs and verifies suspense resolution from manual query data and the first streamed chunk. The previous dedicated suspense test file was removed.

Estimated code review effort: 2 (Simple) | ~10 minutes

Merge Risk: ⚪ Minimal · up to a79d0

This change only reorganizes existing suspense regression tests without changing published code or test behavior, so no actionable merge-blocking risk remains beyond normal checks and review.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes moving the Vue Query suspense regression tests into useQuery.test.ts.
Description check ✅ Passed The description explains the test relocation, confirms behavior preservation, documents validation, and completes all required checklist sections.
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 1 files.
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.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch test/vue-query-useQuery-suspense-move

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.

@pkg-pr-new

pkg-pr-new Bot commented Aug 22, 2026

Copy link
Copy Markdown
More templates

@tanstack/angular-query-experimental

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

@tanstack/eslint-plugin-query

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

@tanstack/lit-query

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

@tanstack/preact-query

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

@tanstack/preact-query-devtools

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

@tanstack/preact-query-persist-client

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

@tanstack/query-async-storage-persister

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

@tanstack/query-broadcast-client-experimental

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

@tanstack/query-core

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

@tanstack/query-devtools

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

@tanstack/query-persist-client-core

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

@tanstack/query-sync-storage-persister

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

@tanstack/react-query

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

@tanstack/react-query-devtools

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

@tanstack/react-query-next-experimental

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

@tanstack/react-query-persist-client

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

@tanstack/solid-query

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

@tanstack/solid-query-devtools

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

@tanstack/solid-query-persist-client

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

@tanstack/svelte-query

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

@tanstack/svelte-query-devtools

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

@tanstack/svelte-query-persist-client

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

@tanstack/vue-query

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

@tanstack/vue-query-devtools

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

commit: a79d0fa

@github-actions

Copy link
Copy Markdown
Contributor

size-limit report 📦

Path Size
react full 11.98 KB (0%)
react minimal 8.92 KB (0%)

@sukvvon
sukvvon merged commit 9fa03e6 into main Aug 22, 2026
9 checks passed
@sukvvon
sukvvon deleted the test/vue-query-useQuery-suspense-move branch August 22, 2026 03:28
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