Skip to content

test(solid-query-devtools/devtools{,Panel}): add tests for the non-development fallback - #10848

Merged
sukvvon merged 1 commit into
mainfrom
test/solid-query-devtools-non-development-fallback
May 31, 2026
Merged

test(solid-query-devtools/devtools{,Panel}): add tests for the non-development fallback#10848
sukvvon merged 1 commit into
mainfrom
test/solid-query-devtools-non-development-fallback

Conversation

@sukvvon

@sukvvonsukvvon commented May 31, 2026

Copy link
Copy Markdown
Member

🎯 Changes

Add a non-development fallback test case to both SolidQueryDevtools and SolidQueryDevtoolsPanel, mirroring the matrix that already exists for the React, Preact, and Vue adapters.

Unlike React/Preact/Vue, Solid does not switch on process.env.NODE_ENV. The index.tsx of @tanstack/solid-query-devtools reads isDev from solid-js/web, which is a build-time constant, so the usual vi.stubEnv('NODE_ENV', 'production') approach has no effect here. The new case swaps isDev to false via per-test vi.doMock('solid-js/web', ...) and dynamically imports the module to exercise the fallback branch.

✅ 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 ensuring devtools UI and panel remain disabled (return null) when the runtime reports a non-development environment, including safeguards to avoid test cross-contamination.

@coderabbitai

coderabbitaiBot commented May 31, 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: b7b7cbbf-9fb0-4c9e-a5f5-10cbf4c836d8

📥 Commits

Reviewing files that changed from the base of the PR and between 52e1b7f and 6962c9e.

📒 Files selected for processing (2)
  • packages/solid-query-devtools/src/__tests__/devtools.test.tsx
  • packages/solid-query-devtools/src/__tests__/devtoolsPanel.test.tsx
🚧 Files skipped from review as they are similar to previous changes (2)
  • packages/solid-query-devtools/src/tests/devtools.test.tsx
  • packages/solid-query-devtools/src/tests/devtoolsPanel.test.tsx

📝 Walkthrough

Walkthrough

The PR adds two Vitest tests that assert SolidQueryDevtools and SolidQueryDevtoolsPanel return null when solid-js/web reports isDev: false. Each test mocks solid-js/web, resets modules, dynamically imports the module, asserts the null result, and cleans up in a finally block.

Changes

Production environment null-return tests

Layer / File(s)Summary
Production environment null-return tests
packages/solid-query-devtools/src/__tests__/devtools.test.tsx, packages/solid-query-devtools/src/__tests__/devtoolsPanel.test.tsx
Added two tests that mock isDev: false and verify SolidQueryDevtools and SolidQueryDevtoolsPanel return null. Tests reset modules, dynamically import the modules to pick up mocks, assert null, and restore module state in finally blocks.

Possibly related PRs

  • TanStack/query#10827: Extends devtoolsPanel.test.tsx with additional test coverage for prop wiring, default fallbacks, and unmount behavior.

Poem

🐰 In tests I hop, mock set to false,
I reset the world, import with a pulse.
The factory wakes, then sleeps with a lull—
Production is quiet, the devtools are null. 🥕🐇

🎯 2 (Simple) | ⏱️ ~10 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check nameStatusExplanation
Title check✅ PassedThe title clearly describes the main change: adding tests for the non-development fallback in solid-query-devtools for both devtools and devtoolsPanel modules.
Description check✅ PassedThe description follows the template structure, explains the changes and their motivation, includes completed checklist items, and correctly identifies the release impact as dev-only.
Docstring Coverage✅ PassedNo functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check✅ PassedCheck skipped because no linked issues were found for this pull request.
Out of Scope Changes check✅ PassedCheck 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-devtools-non-development-fallback

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

@sukvvonsukvvon self-assigned this May 31, 2026
@nx-cloud

nx-cloudBot commented May 31, 2026

Copy link
Copy Markdown

View your CI Pipeline Execution ↗ for commit 52e1b7f

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

☁️ Nx Cloud last updated this comment at 2026-05-31 18:25:55 UTC

@github-actions

github-actionsBot commented May 31, 2026

Copy link
Copy Markdown
Contributor

🚀 Changeset Version Preview

2 package(s) bumped directly, 23 bumped as dependents.

🟩 Patch bumps

PackageVersionReason
@tanstack/lit-query0.2.6 → 0.2.7Changeset
@tanstack/query-devtools5.100.14 → 5.100.15Changeset
@tanstack/angular-query-experimental5.100.14 → 5.100.15Dependent
@tanstack/angular-query-persist-client5.100.14 → 5.100.15Dependent
@tanstack/eslint-plugin-query5.100.14 → 5.100.15Dependent
@tanstack/preact-query5.100.14 → 5.100.15Dependent
@tanstack/preact-query-devtools5.100.14 → 5.100.15Dependent
@tanstack/preact-query-persist-client5.100.14 → 5.100.15Dependent
@tanstack/query-async-storage-persister5.100.14 → 5.100.15Dependent
@tanstack/query-broadcast-client-experimental5.100.14 → 5.100.15Dependent
@tanstack/query-core5.100.14 → 5.100.15Dependent
@tanstack/query-persist-client-core5.100.14 → 5.100.15Dependent
@tanstack/query-sync-storage-persister5.100.14 → 5.100.15Dependent
@tanstack/react-query5.100.14 → 5.100.15Dependent
@tanstack/react-query-devtools5.100.14 → 5.100.15Dependent
@tanstack/react-query-next-experimental5.100.14 → 5.100.15Dependent
@tanstack/react-query-persist-client5.100.14 → 5.100.15Dependent
@tanstack/solid-query5.100.14 → 5.100.15Dependent
@tanstack/solid-query-devtools5.100.14 → 5.100.15Dependent
@tanstack/solid-query-persist-client5.100.14 → 5.100.15Dependent
@tanstack/svelte-query6.1.33 → 6.1.34Dependent
@tanstack/svelte-query-devtools6.1.33 → 6.1.34Dependent
@tanstack/svelte-query-persist-client6.1.33 → 6.1.34Dependent
@tanstack/vue-query5.100.14 → 5.100.15Dependent
@tanstack/vue-query-devtools6.1.33 → 6.1.34Dependent

@pkg-pr-new

pkg-pr-newBot commented May 31, 2026

Copy link
Copy Markdown
More templates

@tanstack/angular-query-experimental

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

@tanstack/eslint-plugin-query

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

@tanstack/lit-query

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

@tanstack/preact-query

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

@tanstack/preact-query-devtools

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

@tanstack/preact-query-persist-client

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

@tanstack/query-async-storage-persister

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

@tanstack/query-broadcast-client-experimental

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

@tanstack/query-core

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

@tanstack/query-devtools

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

@tanstack/query-persist-client-core

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

@tanstack/query-sync-storage-persister

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

@tanstack/react-query

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

@tanstack/react-query-devtools

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

@tanstack/react-query-next-experimental

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

@tanstack/react-query-persist-client

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

@tanstack/solid-query

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

@tanstack/solid-query-devtools

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

@tanstack/solid-query-persist-client

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

@tanstack/svelte-query

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

@tanstack/svelte-query-devtools

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

@tanstack/svelte-query-persist-client

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

@tanstack/vue-query

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

@tanstack/vue-query-devtools

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

commit: 6962c9e

@github-actions

github-actionsBot commented May 31, 2026

Copy link
Copy Markdown
Contributor

size-limit report 📦

PathSize
react full12.11 KB (0%)
react minimal9.08 KB (0%)

@sukvvonsukvvon changed the title test(solid-query-devtools/devtools{,Panel}): add a non-development fallback casetest(solid-query-devtools/devtools{,Panel}): add tests for the non-development fallbackMay 31, 2026
@sukvvon
sukvvonforce-pushed the test/solid-query-devtools-non-development-fallback branch from 52e1b7f to 6962c9eCompareMay 31, 2026 18:24
@sukvvon
sukvvon merged commit 9d488a1 into mainMay 31, 2026
9 checks passed
@sukvvon
sukvvon deleted the test/solid-query-devtools-non-development-fallback branch May 31, 2026 18:26
Sign up for freeto 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

@sukvvon