Skip to content

test(solid-query/useQueries): add test for using a provided custom 'queryClient'#10952

Merged
sukvvon merged 1 commit into
mainfrom
test/solid-query-useQueries-custom-queryclient
Jun 14, 2026
Merged

test(solid-query/useQueries): add test for using a provided custom 'queryClient'#10952
sukvvon merged 1 commit into
mainfrom
test/solid-query-useQueries-custom-queryclient

Conversation

@sukvvon

@sukvvon sukvvon commented Jun 14, 2026

Copy link
Copy Markdown
Member

🎯 Changes

react-query's useQueries tests cover passing a custom queryClient as the second argument (instead of relying on QueryClientProvider), but solid-query had no equivalent. This ports that coverage.

  • Add a test that calls useQueries(() => ({ queries }), () => queryClient) with the client passed directly as the second argument, renders without a QueryClientProvider, and asserts the query resolves against that client.

The test passes against the current behavior — no source 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
    • Added test coverage verifying custom query client parameter support in the queries functionality.

@coderabbitai

coderabbitai Bot commented Jun 14, 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: e684528e-707d-430f-b69c-ed10188e37fb

📥 Commits

Reviewing files that changed from the base of the PR and between 588b30f and 4e6c0e1.

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

📝 Walkthrough

Walkthrough

A single test file is updated: render is added to the @solidjs/testing-library import, and a new test case is added that passes a custom QueryClient as the second argument to useQueries, advances fake timers, and asserts the rendered DOM text comes from that custom client.

Changes

Custom queryClient test for useQueries

Layer / File(s) Summary
Custom queryClient test case and import
packages/solid-query/src/__tests__/useQueries.test.tsx
Adds render to the testing-library import and introduces a test that constructs a custom QueryClient, passes it to useQueries, advances fake timers, and asserts the resulting DOM text reflects data from that client.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Possibly related PRs

  • TanStack/query#10950: Touches the same useQueries.test.tsx file and adjusts how a custom QueryClient is wired into the test render.
  • TanStack/query#10951: Also modifies useQueries.test.tsx by adding a useQueries-specific test case around query fetching behavior.
  • TanStack/query#10916: Adds and adjusts tests around providing a custom queryClient to solid-query hooks in a similar pattern.

Poem

🐇 Hippity-hop, a new client in tow,
I pass it to useQueries and watch data flow.
Fake timers tick, the DOM lights up bright,
My custom QueryClient fetches just right.
A quick little test, neat and petite—
This bunny's review stack is now complete! 🌿

🚥 Pre-merge checks | ✅ 4 | ❌ 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 (4 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately and specifically describes the main change—adding a test for custom queryClient in useQueries.
Description check ✅ Passed The description follows the template with complete sections: Changes explains the test addition with clear context, Checklist items are marked appropriately (both contributing guide and testing completed), and Release Impact correctly identifies this as dev-only.
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.

✏️ 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-useQueries-custom-queryclient

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

@sukvvon sukvvon self-assigned this Jun 14, 2026
@nx-cloud

nx-cloud Bot commented Jun 14, 2026

Copy link
Copy Markdown

View your CI Pipeline Execution ↗ for commit 4e6c0e1

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

☁️ Nx Cloud last updated this comment at 2026-06-14 19:44:41 UTC

@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-new Bot commented Jun 14, 2026

Copy link
Copy Markdown
More templates

@tanstack/angular-query-experimental

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

@tanstack/eslint-plugin-query

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

@tanstack/lit-query

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

@tanstack/preact-query

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

@tanstack/preact-query-devtools

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

@tanstack/preact-query-persist-client

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

@tanstack/query-async-storage-persister

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

@tanstack/query-broadcast-client-experimental

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

@tanstack/query-core

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

@tanstack/query-devtools

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

@tanstack/query-persist-client-core

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

@tanstack/query-sync-storage-persister

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

@tanstack/react-query

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

@tanstack/react-query-devtools

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

@tanstack/react-query-next-experimental

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

@tanstack/react-query-persist-client

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

@tanstack/solid-query

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

@tanstack/solid-query-devtools

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

@tanstack/solid-query-persist-client

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

@tanstack/svelte-query

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

@tanstack/svelte-query-devtools

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

@tanstack/svelte-query-persist-client

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

@tanstack/vue-query

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

@tanstack/vue-query-devtools

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

commit: 4e6c0e1

@github-actions

Copy link
Copy Markdown
Contributor

size-limit report 📦

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

@sukvvon sukvvon merged commit 86b949b into main Jun 14, 2026
9 checks passed
@sukvvon sukvvon deleted the test/solid-query-useQueries-custom-queryclient branch June 14, 2026 19:45
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