Skip to content

test(query-core/{hydration,queriesObserver}): remove unnecessary 'async' from tests without 'await'#11035

Merged
sukvvon merged 1 commit into
mainfrom
test/query-core-remove-unnecessary-async
Jul 8, 2026
Merged

test(query-core/{hydration,queriesObserver}): remove unnecessary 'async' from tests without 'await'#11035
sukvvon merged 1 commit into
mainfrom
test/query-core-remove-unnecessary-async

Conversation

@sukvvon

@sukvvon sukvvon commented Jul 8, 2026

Copy link
Copy Markdown
Member

🎯 Changes

Removes the async keyword from it callbacks that contain no await in their body, in two query-core test files:

  • hydration.test.tsx (3 tests): rehydrating an existing pending query with a synchronously resolved promise, and setting dataUpdatedAt when hydrating a resolved streamed query into a new / existing cache entry.
  • queriesObserver.test.tsx (2 tests): skipping combine notifications while suspense queries have no data, and after suspense is enabled without structural changes.

These callbacks were marked async but never awaited anything, so the marker is unnecessary.

✅ 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

  • Tests
    • Updated hydration and query observer tests to use synchronous execution where appropriate.
    • Improved coverage for hydration state updates and suspense-related notification behavior.

@nx-cloud

nx-cloud Bot commented Jul 8, 2026

Copy link
Copy Markdown

View your CI Pipeline Execution ↗ for commit b32d5ba

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

☁️ Nx Cloud last updated this comment at 2026-07-08 01:02:34 UTC

@github-actions

github-actions Bot commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

🚀 Changeset Version Preview

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

@sukvvon sukvvon self-assigned this Jul 8, 2026
@coderabbitai

coderabbitai Bot commented Jul 8, 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

Run ID: 19ddf821-215c-43a8-8c5b-d2b25282d2df

📥 Commits

Reviewing files that changed from the base of the PR and between bb68fa0 and b32d5ba.

📒 Files selected for processing (2)
  • packages/query-core/src/__tests__/hydration.test.tsx
  • packages/query-core/src/__tests__/queriesObserver.test.tsx

📝 Walkthrough

Walkthrough

This PR removes the async modifier from five test callback functions across two test files, converting them from asynchronous to synchronous test declarations. No test logic or assertions were changed.

Changes

Test callback signature cleanup

Layer / File(s) Summary
Hydration test callbacks
packages/query-core/src/__tests__/hydration.test.tsx
Three tests validating status and dataUpdatedAt during hydration were changed from async to synchronous callbacks.
QueriesObserver test callbacks
packages/query-core/src/__tests__/queriesObserver.test.tsx
Two suspense combine-notification tests were changed from async to synchronous callbacks.

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

Possibly related PRs

  • TanStack/query#10610: Overlaps directly on hydration test scenarios and dataUpdatedAt behavior touched by this PR.

Suggested labels: package: query-core

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: removing unnecessary async from query-core tests.
Description check ✅ Passed The description follows the template with changes, checklist, and release impact sections filled in.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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/query-core-remove-unnecessary-async

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

@pkg-pr-new

pkg-pr-new Bot commented Jul 8, 2026

Copy link
Copy Markdown
More templates

@tanstack/angular-query-experimental

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

@tanstack/eslint-plugin-query

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

@tanstack/lit-query

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

@tanstack/preact-query

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

@tanstack/preact-query-devtools

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

@tanstack/preact-query-persist-client

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

@tanstack/query-async-storage-persister

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

@tanstack/query-broadcast-client-experimental

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

@tanstack/query-core

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

@tanstack/query-devtools

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

@tanstack/query-persist-client-core

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

@tanstack/query-sync-storage-persister

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

@tanstack/react-query

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

@tanstack/react-query-devtools

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

@tanstack/react-query-next-experimental

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

@tanstack/react-query-persist-client

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

@tanstack/solid-query

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

@tanstack/solid-query-devtools

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

@tanstack/solid-query-persist-client

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

@tanstack/svelte-query

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

@tanstack/svelte-query-devtools

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

@tanstack/svelte-query-persist-client

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

@tanstack/vue-query

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

@tanstack/vue-query-devtools

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

commit: b32d5ba

@github-actions

github-actions Bot commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

size-limit report 📦

Path Size
react full 12.13 KB (0%)
react minimal 9.08 KB (0%)

@sukvvon sukvvon merged commit 64241b8 into main Jul 8, 2026
9 checks passed
@sukvvon sukvvon deleted the test/query-core-remove-unnecessary-async branch July 8, 2026 01:39
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