Skip to content

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

Merged
sukvvon merged 1 commit intomainfrom
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 intomainfrom
test/react-query-useSuspenseQueries-replace-async-await-sleep

Conversation

@sukvvon
Copy link
Copy Markdown
Collaborator

@sukvvon sukvvon commented Apr 6, 2026

🎯 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
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Apr 6, 2026

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 name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring 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 name Status Explanation
Title check ✅ Passed The title accurately describes the main change: replacing async/await sleep pattern with promise-then style in the test file's queryFn.
Description check ✅ Passed The 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
Copy link
Copy Markdown

nx-cloud bot commented Apr 6, 2026

View your CI Pipeline Execution ↗ for commit f16661e

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

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

@sukvvon sukvvon self-assigned this Apr 6, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 6, 2026

🚀 Changeset Version Preview

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

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new bot commented Apr 6, 2026

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

github-actions bot commented Apr 6, 2026

size-limit report 📦

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

@sukvvon sukvvon merged commit 3d6e001 into main Apr 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 free to 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