Skip to content

test(react-query/useSuspenseQueries): replace 'async/await sleep' with 'sleep().then()' in 'queryFn' - #10403

Merged
sukvvon merged 1 commit into
mainfrom
test/react-query-useSuspenseQueries-replace-async-await-sleep
Apr 6, 2026
Merged

test(react-query/useSuspenseQueries): replace 'async/await sleep' with 'sleep().then()' in 'queryFn'#10403
sukvvon merged 1 commit into
mainfrom
test/react-query-useSuspenseQueries-replace-async-await-sleep

Conversation

@sukvvon

@sukvvonsukvvon commented Apr 6, 2026

Copy link
Copy Markdown
Member

🎯 Changes

✅ 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
    • Refactored test implementations in suspend queries by converting query functions from async/await style to promise-based syntax while maintaining all test behavior and timing characteristics.

@coderabbitai

coderabbitaiBot commented Apr 6, 2026

Copy link
Copy Markdown
Contributor

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 071d7bc1-5450-40e6-adce-e79bb212eec2

📥 Commits

Reviewing files that changed from the base of the PR and between eac62b8 and f16661e.

📒 Files selected for processing (1)
  • packages/react-query/src/__tests__/useSuspenseQueries.test.tsx

📝 Walkthrough

Walkthrough

Converted a test queryFn in useSuspenseQueries.test.tsx from async/await style to promise-return style. The function now returns sleep().then() directly instead of awaiting sleep() in an async block.

Changes

Cohort / File(s)Summary
Test code refactoring
packages/react-query/src/__tests__/useSuspenseQueries.test.tsx
Converted queryFn from async/await pattern to promise-return pattern while preserving behavior and timing.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Possibly related PRs

Suggested labels

package: react-query

Poem

🐰 A hop and a skip, the async we flick,
Promises flow now, oh so slick!
No await delays, just .then() ways,
Tests run cleaner in all their days!

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check nameStatusExplanationResolution
Docstring Coverage⚠️ WarningDocstring coverage is 0.00% which is insufficient. The required threshold is 80.00%.Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check nameStatusExplanation
Title check✅ PassedThe title accurately describes the main change: replacing async/await sleep pattern with promise-then style in the test file's queryFn.
Description check✅ PassedThe description includes all required template sections with appropriate content: clear explanation of changes, completed checklist items, and proper release impact marking.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ 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/react-query-useSuspenseQueries-replace-async-await-sleep

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

@nx-cloud

nx-cloudBot commented Apr 6, 2026

Copy link
Copy Markdown

View your CI Pipeline Execution ↗ for commit f16661e

CommandStatusDurationResult
nx affected --targets=test:sherif,test:knip,tes...✅ Succeeded2m 12sView ↗
nx run-many --target=build --exclude=examples/*...✅ Succeeded<1sView ↗

☁️ Nx Cloud last updated this comment at 2026-04-06 10:09:28 UTC

@sukvvonsukvvon self-assigned this Apr 6, 2026
@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-newBot commented Apr 6, 2026

Copy link
Copy Markdown
More templates

@tanstack/angular-query-experimental

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

@tanstack/eslint-plugin-query

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

@tanstack/preact-query

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

@tanstack/preact-query-devtools

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

@tanstack/preact-query-persist-client

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

@tanstack/query-async-storage-persister

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

@tanstack/query-broadcast-client-experimental

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

@tanstack/query-core

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

@tanstack/query-devtools

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

@tanstack/query-persist-client-core

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

@tanstack/query-sync-storage-persister

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

@tanstack/react-query

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

@tanstack/react-query-devtools

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

@tanstack/react-query-next-experimental

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

@tanstack/react-query-persist-client

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

@tanstack/solid-query

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

@tanstack/solid-query-devtools

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

@tanstack/solid-query-persist-client

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

@tanstack/svelte-query

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

@tanstack/svelte-query-devtools

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

@tanstack/svelte-query-persist-client

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

@tanstack/vue-query

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

@tanstack/vue-query-devtools

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

commit: f16661e

@github-actions

Copy link
Copy Markdown
Contributor

size-limit report 📦

PathSize
react full11.98 KB (0%)
react minimal9.01 KB (0%)

@sukvvon
sukvvon merged commit 3d6e001 into mainApr 6, 2026
10 checks passed
@sukvvon
sukvvon deleted the test/react-query-useSuspenseQueries-replace-async-await-sleep branch April 6, 2026 10:19
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

@sukvvon