Skip to content

test(solid-query/useMutationState): add test for default 'options' parameter coverage#10148

Merged
TkDodo merged 1 commit intoTanStack:mainfrom
sukvvon:test/solid-query-useMutationState-default-options
Feb 18, 2026
Merged

test(solid-query/useMutationState): add test for default 'options' parameter coverage#10148
TkDodo merged 1 commit intoTanStack:mainfrom
sukvvon:test/solid-query-useMutationState-default-options

Conversation

@sukvvon
Copy link
Contributor

@sukvvon sukvvon commented Feb 18, 2026

🎯 Changes

  • Add test for calling useMutationState() without options to cover the default options parameter (() => ({}))
  • In Solid's Accessor pattern, the default arrow function is tracked as a separate branch by istanbul, so explicit coverage is needed unlike react-query

✅ 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 for useMutationState validation with no options and mutation state tracking behavior.

@changeset-bot
Copy link

changeset-bot bot commented Feb 18, 2026

⚠️ No Changeset found

Latest commit: 29a1eff

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 18, 2026

No actionable comments were generated in the recent review. 🎉


📝 Walkthrough

Walkthrough

A new test case is added to validate that useMutationState() with no options returns the complete set of mutation states, exercising mutation triggers and state array length assertions across a timer-based workflow.

Changes

Cohort / File(s) Summary
useMutationState Test Suite
packages/solid-query/src/__tests__/useMutationState.test.tsx
New test case validating useMutationState() with no options parameter returns full mutation states; includes mutation trigger component and state verification with timer advancement.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐰 A test so fine, with states that shine,
No options passed, the logic divine,
Timers advance, mutations flow,
Coverage grows, watch the tests glow!

🚥 Pre-merge checks | ✅ 2 | ❌ 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 (2 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and specifically describes the main change: adding a test for default 'options' parameter coverage in useMutationState, which matches the actual test addition.
Description check ✅ Passed The description includes all required sections from the template (Changes, Checklist, Release Impact), provides clear context about why the test is needed, and completes the necessary checkboxes appropriately.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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

@nx-cloud
Copy link

nx-cloud bot commented Feb 18, 2026

View your CI Pipeline Execution ↗ for commit 29a1eff

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

☁️ Nx Cloud last updated this comment at 2026-02-18 08:24:02 UTC

@pkg-pr-new
Copy link

pkg-pr-new bot commented Feb 18, 2026

More templates

@tanstack/angular-query-experimental

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

@tanstack/eslint-plugin-query

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

@tanstack/preact-query

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

@tanstack/query-async-storage-persister

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

@tanstack/query-broadcast-client-experimental

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

@tanstack/query-core

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

@tanstack/query-devtools

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

@tanstack/query-persist-client-core

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

@tanstack/query-sync-storage-persister

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

@tanstack/react-query

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

@tanstack/react-query-devtools

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

@tanstack/react-query-next-experimental

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

@tanstack/react-query-persist-client

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

@tanstack/solid-query

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

@tanstack/solid-query-devtools

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

@tanstack/solid-query-persist-client

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

@tanstack/svelte-query

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

@tanstack/svelte-query-devtools

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

@tanstack/svelte-query-persist-client

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

@tanstack/vue-query

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

@tanstack/vue-query-devtools

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

commit: 29a1eff

@TkDodo TkDodo merged commit bb257c2 into TanStack:main Feb 18, 2026
7 checks passed
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.

2 participants

Comments