Skip to content

test(svelte-query/useMutationState): add type tests for default 'MutationState' and 'select' inference#10504

Merged
sukvvon merged 1 commit intomainfrom
test/svelte-query-useMutationState-type-tests
Apr 15, 2026
Merged

test(svelte-query/useMutationState): add type tests for default 'MutationState' and 'select' inference#10504
sukvvon merged 1 commit intomainfrom
test/svelte-query-useMutationState-type-tests

Conversation

@sukvvon
Copy link
Copy Markdown
Collaborator

@sukvvon sukvvon commented Apr 15, 2026

🎯 Changes

Add type tests for useMutationState in svelte-query, covering:

  • Default return type (Array<MutationState>) when no select is provided
  • TResult inference from select callback

✅ 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 type declaration tests for useMutationState to ensure proper TypeScript type inference with and without filter options and select functions.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Apr 15, 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: f4a5f9b4-7760-43d8-92b0-091db257db1c

📥 Commits

Reviewing files that changed from the base of the PR and between da62c8a and 2d0f1c4.

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

📝 Walkthrough

Walkthrough

Added a TypeScript declaration test file for the useMutationState hook in the svelte-query package. The test validates generic type inference for the hook's return type with and without the optional select parameter using type-level assertions.

Changes

Cohort / File(s) Summary
TypeScript Type Tests
packages/svelte-query/tests/useMutationState/useMutationState.test-d.ts
Added type-level declaration tests for useMutationState validating generic type inference. Includes assertions for return types with filters only and with select functions.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Poem

🐰 Types now dance in svelte's domain,
MutationState tests, crystal clear and plain,
Select functions shape the generic flow,
A rabbit's quest for type-safety glow! ✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: adding type tests for useMutationState in svelte-query covering default return type and select inference.
Description check ✅ Passed The description follows the template with all required sections completed: Changes section clearly describes what was added, Checklist items are properly marked, and Release Impact correctly indicates this is 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/svelte-query-useMutationState-type-tests

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

@nx-cloud
Copy link
Copy Markdown

nx-cloud bot commented Apr 15, 2026

View your CI Pipeline Execution ↗ for commit 2d0f1c4

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

☁️ Nx Cloud last updated this comment at 2026-04-15 08:24:16 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
Copy link
Copy Markdown

pkg-pr-new bot commented Apr 15, 2026

More templates

@tanstack/angular-query-experimental

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

@tanstack/eslint-plugin-query

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

@tanstack/preact-query

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

@tanstack/preact-query-devtools

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

@tanstack/preact-query-persist-client

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

@tanstack/query-async-storage-persister

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

@tanstack/query-broadcast-client-experimental

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

@tanstack/query-core

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

@tanstack/query-devtools

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

@tanstack/query-persist-client-core

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

@tanstack/query-sync-storage-persister

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

@tanstack/react-query

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

@tanstack/react-query-devtools

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

@tanstack/react-query-next-experimental

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

@tanstack/react-query-persist-client

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

@tanstack/solid-query

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

@tanstack/solid-query-devtools

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

@tanstack/solid-query-persist-client

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

@tanstack/svelte-query

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

@tanstack/svelte-query-devtools

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

@tanstack/svelte-query-persist-client

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

@tanstack/vue-query

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

@tanstack/vue-query-devtools

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

commit: 2d0f1c4

@github-actions
Copy link
Copy Markdown
Contributor

size-limit report 📦

Path Size
react full 11.99 KB (0%)
react minimal 9.02 KB (0%)

@sukvvon sukvvon merged commit c47c671 into main Apr 15, 2026
10 checks passed
@sukvvon sukvvon deleted the test/svelte-query-useMutationState-type-tests branch April 15, 2026 08:39
@sukvvon sukvvon self-assigned this Apr 15, 2026
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