Skip to content

test(solid-query): replace 'async/await sleep' with 'sleep().then()' in test 'queryFn' and 'mutationFn'#10398

Merged
sukvvon merged 1 commit intomainfrom
test/solid-query-replace-async-await-sleep-with-then-chaining
Apr 6, 2026
Merged

test(solid-query): replace 'async/await sleep' with 'sleep().then()' in test 'queryFn' and 'mutationFn'#10398
sukvvon merged 1 commit intomainfrom
test/solid-query-replace-async-await-sleep-with-then-chaining

Conversation

@sukvvon
Copy link
Copy Markdown
Collaborator

@sukvvon sukvvon commented Apr 6, 2026

🎯 Changes

  • Replace async () => { await sleep(N); return value } with () => sleep(N).then(() => value) in test queryFn and mutationFn
  • Applied to QueryClientProvider.test.tsx, transition.test.tsx, useMutation.test.tsx, useMutationState.test.tsx, and useQueries.test.tsx

✅ 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 across query modules for improved code consistency and maintainability.

@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: d4f43c38-5df0-4d7d-bc30-6287fd6bb79a

📥 Commits

Reviewing files that changed from the base of the PR and between abf8547 and 88405a6.

📒 Files selected for processing (5)
  • packages/solid-query/src/__tests__/QueryClientProvider.test.tsx
  • packages/solid-query/src/__tests__/transition.test.tsx
  • packages/solid-query/src/__tests__/useMutation.test.tsx
  • packages/solid-query/src/__tests__/useMutationState.test.tsx
  • packages/solid-query/src/__tests__/useQueries.test.tsx

📝 Walkthrough

Walkthrough

Five test files were refactored to convert query and mutation function implementations from async/await style to promise chaining style, replacing async () => { await sleep(...); return value } patterns with () => sleep(...).then(() => value). The asynchronous behavior and test semantics remain unchanged.

Changes

Cohort / File(s) Summary
Test Function Refactoring
packages/solid-query/src/__tests__/QueryClientProvider.test.tsx, transition.test.tsx, useMutation.test.tsx, useMutationState.test.tsx, useQueries.test.tsx
Converted queryFn and mutationFn implementations from async/await syntax to promise chaining with .then(). Asynchronous delays and return values preserved; control flow style updated across multiple test cases.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~4 minutes

Poem

🐰 From await to .then() we hop,
Simplifying flows without a stop,
Promises chain in cleaner style,
Tests still pass with bunny smile! ✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main change: replacing async/await sleep patterns with promise chaining in test functions across multiple test files.
Description check ✅ Passed The description follows the template structure with completed 🎯 Changes and 🚀 Release Impact sections. It appropriately marks the change as dev-only with no changeset needed.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ 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/solid-query-replace-async-await-sleep-with-then-chaining

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 88405a6

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

☁️ Nx Cloud last updated this comment at 2026-04-06 04:24:56 UTC

@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.

@sukvvon sukvvon self-assigned this Apr 6, 2026
@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@10398

@tanstack/eslint-plugin-query

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

@tanstack/preact-query

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

@tanstack/preact-query-devtools

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

@tanstack/preact-query-persist-client

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

@tanstack/query-async-storage-persister

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

@tanstack/query-broadcast-client-experimental

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

@tanstack/query-core

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

@tanstack/query-devtools

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

@tanstack/query-persist-client-core

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

@tanstack/query-sync-storage-persister

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

@tanstack/react-query

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

@tanstack/react-query-devtools

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

@tanstack/react-query-next-experimental

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

@tanstack/react-query-persist-client

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

@tanstack/solid-query

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

@tanstack/solid-query-devtools

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

@tanstack/solid-query-persist-client

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

@tanstack/svelte-query

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

@tanstack/svelte-query-devtools

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

@tanstack/svelte-query-persist-client

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

@tanstack/vue-query

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

@tanstack/vue-query-devtools

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

commit: 88405a6

@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 ef2a4e3 into main Apr 6, 2026
10 checks passed
@sukvvon sukvvon deleted the test/solid-query-replace-async-await-sleep-with-then-chaining branch April 6, 2026 04:26
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