Skip to content

test(svelte-query/createQueries): move type tests from 'createQueries.svelte.test.ts' to 'createQueries.test-d.ts' - #10389

Merged
sukvvon merged 2 commits into
mainfrom
test/svelte-query-createQueries-move-type-tests
Apr 5, 2026
Merged

test(svelte-query/createQueries): move type tests from 'createQueries.svelte.test.ts' to 'createQueries.test-d.ts'#10389
sukvvon merged 2 commits into
mainfrom
test/svelte-query-createQueries-move-type-tests

Conversation

@sukvvon

@sukvvonsukvvon commented Apr 5, 2026

Copy link
Copy Markdown
Member

🎯 Changes

  • Move 4 pure type tests from createQueries.svelte.test.ts to createQueries.test-d.ts
    • handles type parameter - tuple of tuples
    • handles type parameter - tuple of objects
    • handles array literal without type parameter to infer result type
    • handles strongly typed queryFn factories and createQueries wrappers
  • Remove expectTypeOf, withEffectRoot wrapper, and unused type imports from runtime test file
  • Follows the existing svelte-query pattern of separating runtime tests (.svelte.test.ts) from type tests (.test-d.ts)

✅ 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
    • Reorganized type-safety test coverage for createQueries, expanding validation of generic parameter handling and type inference scenarios to ensure robust typing behavior across tuple-based and array-based query configurations.

….svelte.test.ts' to 'createQueries.test-d.ts'
@coderabbitai

coderabbitaiBot commented Apr 5, 2026

Copy link
Copy Markdown
Contributor

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 40f8a849-5338-4fa0-842b-efbcd5785b82

📥 Commits

Reviewing files that changed from the base of the PR and between 7781a3e and 5d475fa.

📒 Files selected for processing (2)
  • packages/svelte-query/tests/createQueries/createQueries.svelte.test.ts
  • packages/svelte-query/tests/createQueries/createQueries.test-d.ts

📝 Walkthrough

Walkthrough

The pull request reorganizes type-level test coverage for the createQueries function across two test files. Type-checking tests and associated imports are removed from the main test file, while comprehensive type-test coverage is added to a dedicated type-test file with expanded test scenarios.

Changes

Cohort / File(s)Summary
Type Test Removal
packages/svelte-query/tests/createQueries/createQueries.svelte.test.ts
Removed unused imports (expectTypeOf and several type imports), deleted three large test blocks performing compile-time type assertions using expectTypeOf. Runtime tests and CreateQueryResult usage remain unchanged.
Type Test Addition
packages/svelte-query/tests/createQueries/createQueries.test-d.ts
Expanded type-test coverage by importing additional public types and QueryClient, adding comprehensive test cases for generic parameter handling (tuples/objects), type inference for array literals, and strongly typed queryFn factories with validation of TypeScript error expectations.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Poem

🐰 Tests hop from one warren to another,
Type checks dance in files so fine,
Organized with care, we recover,
Coverage blooms in each design!

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check nameStatusExplanation
Title check✅ PassedThe title accurately summarizes the main change: moving type tests from one file to another, with clear specificity about which files and what type of tests.
Description check✅ PassedThe description includes all required sections from the template (Changes, Checklist, Release Impact) with detailed information about what was moved and why.
Docstring Coverage✅ PassedNo 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/svelte-query-createQueries-move-type-tests

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

@nx-cloud

nx-cloudBot commented Apr 5, 2026

Copy link
Copy Markdown

View your CI Pipeline Execution ↗ for commit 5d475fa

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

☁️ Nx Cloud last updated this comment at 2026-04-05 10:50:34 UTC

@github-actions

github-actionsBot commented Apr 5, 2026

Copy link
Copy Markdown
Contributor

🚀 Changeset Version Preview

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

@sukvvonsukvvon self-assigned this Apr 5, 2026
@pkg-pr-new

pkg-pr-newBot commented Apr 5, 2026

Copy link
Copy Markdown
More templates

@tanstack/angular-query-experimental

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

@tanstack/eslint-plugin-query

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

@tanstack/preact-query

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

@tanstack/preact-query-devtools

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

@tanstack/preact-query-persist-client

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

@tanstack/query-async-storage-persister

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

@tanstack/query-broadcast-client-experimental

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

@tanstack/query-core

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

@tanstack/query-devtools

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

@tanstack/query-persist-client-core

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

@tanstack/query-sync-storage-persister

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

@tanstack/react-query

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

@tanstack/react-query-devtools

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

@tanstack/react-query-next-experimental

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

@tanstack/react-query-persist-client

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

@tanstack/solid-query

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

@tanstack/solid-query-devtools

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

@tanstack/solid-query-persist-client

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

@tanstack/svelte-query

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

@tanstack/svelte-query-devtools

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

@tanstack/svelte-query-persist-client

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

@tanstack/vue-query

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

@tanstack/vue-query-devtools

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

commit: 5d475fa

@github-actions

Copy link
Copy Markdown
Contributor

size-limit report 📦

PathSize
react full11.98 KB (0%)
react minimal9.01 KB (0%)

@sukvvon
sukvvon merged commit 80f0370 into mainApr 5, 2026
8 checks passed
@sukvvon
sukvvon deleted the test/svelte-query-createQueries-move-type-tests branch April 5, 2026 11:04
Sign up for freeto 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

@sukvvon