test(solid-query): add 'renderWithClient' helper and replace inline 'QueryClientProvider' wrapping in tests#10950
Conversation
…QueryClientProvider' wrapping in tests
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (11)
📝 WalkthroughWalkthroughIntroduces a ChangesrenderWithClient helper and adoption
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
|
View your CI Pipeline Execution ↗ for commit efb08aa
☁️ Nx Cloud last updated this comment at |
🚀 Changeset Version PreviewNo changeset entries found. Merging this PR will not cause a version bump for any packages. |
size-limit report 📦
|
🎯 Changes
The solid-query tests wrapped almost every render in an inline
QueryClientProvider:react-queryandpreact-queryalready share arenderWithClienthelper in their testutils.tsxfor exactly this; this adds the equivalent to solid-query and uses it across the test suite.renderWithClient(client, ui)tosrc/__tests__/utils.tsx. It mirrors the react/preact helper but takes a() => JSX.Element(matching solid'srender), and returns the underlyingrenderresult unchanged (solid tests don't usererender, so no wrapping is needed).QueryClientProviderwrapping withrenderWithClient(...)across the test files, and drop the now-unusedQueryClientProvider/renderimports.QueryClientProvider.test.tsxis intentionally left untouched — it tests the provider itself (including multiple/nested providers and the missing-provider throw case).No test behavior changes: the whole solid-query suite (21 files, 320 tests) passes with no type errors. Net ~880 fewer lines of boilerplate.
✅ Checklist
pnpm run test:pr.🚀 Release Impact
Summary by CodeRabbit