Skip to content

test({solid,svelte}-query/mutationOptions): replace 'toStrictEqual' with 'toBe' for identity check - #10407

Merged
sukvvon merged 3 commits into
mainfrom
test/react-preact-query-infiniteQueryOptions-use-as-const
Apr 6, 2026
Merged

test({solid,svelte}-query/mutationOptions): replace 'toStrictEqual' with 'toBe' for identity check#10407
sukvvon merged 3 commits into
mainfrom
test/react-preact-query-infiniteQueryOptions-use-as-const

Conversation

@sukvvon

@sukvvonsukvvon commented Apr 6, 2026

Copy link
Copy Markdown
Member

🎯 Changes

  • Replace toStrictEqual with toBe in mutationOptions identity tests for solid-query and svelte-query
  • toBe uses === reference equality which is the correct assertion for identity functions that return the same object
  • Aligns with react-query, preact-query, and all queryOptions/infiniteQueryOptions tests which already use toBe

✅ 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
    • Updated test assertions for mutation options validation across Solid Query and Svelte Query packages.

@coderabbitai

coderabbitaiBot commented Apr 6, 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: 5cfb5086-2917-4621-9815-c0a0cfb5de6b

📥 Commits

Reviewing files that changed from the base of the PR and between 2bb0029 and 0fb91e6.

📒 Files selected for processing (2)
  • packages/solid-query/src/__tests__/mutationOptions.test.tsx
  • packages/svelte-query/tests/mutationOptions/mutationOptions.svelte.test.ts
✅ Files skipped from review due to trivial changes (1)
  • packages/solid-query/src/tests/mutationOptions.test.tsx

📝 Walkthrough

Walkthrough

Test assertions in solid-query and svelte-query mutationOptions tests were updated to verify referential equality (toBe) instead of deep structural equality (toStrictEqual) when comparing returned options objects against their input parameters.

Changes

Cohort / File(s)Summary
Mutation Options Test Assertions
packages/solid-query/src/__tests__/mutationOptions.test.tsx, packages/svelte-query/tests/mutationOptions/mutationOptions.svelte.test.ts
Updated test expectations from toStrictEqual(object) to toBe(object) for asserting that mutationOptions() returns the same object reference, not just an equivalent copy.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Possibly related PRs

Poem

🐰 A little tweak, so small but fine,
From deep equals to reference align,
The bunny hops with glee and cheer,
Same object, same reference, crystal clear!

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check nameStatusExplanation
Title check✅ PassedThe title clearly and specifically describes the main change: replacing toStrictEqual with toBe for identity checks in mutationOptions tests across solid-query and svelte-query packages.
Description check✅ PassedThe description covers the key aspects: what was changed, the rationale behind the change (toBe for reference equality), and alignment with existing patterns in other packages. It properly follows the template structure.
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/react-preact-query-infiniteQueryOptions-use-as-const

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

@nx-cloud

nx-cloudBot commented Apr 6, 2026

Copy link
Copy Markdown

View your CI Pipeline Execution ↗ for commit 0fb91e6

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

☁️ Nx Cloud last updated this comment at 2026-04-06 13:39:49 UTC

@sukvvonsukvvon self-assigned this Apr 6, 2026
@github-actions

github-actionsBot commented Apr 6, 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.

@pkg-pr-new

pkg-pr-newBot commented Apr 6, 2026

Copy link
Copy Markdown
More templates

@tanstack/angular-query-experimental

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

@tanstack/eslint-plugin-query

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

@tanstack/preact-query

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

@tanstack/preact-query-devtools

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

@tanstack/preact-query-persist-client

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

@tanstack/query-async-storage-persister

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

@tanstack/query-broadcast-client-experimental

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

@tanstack/query-core

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

@tanstack/query-devtools

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

@tanstack/query-persist-client-core

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

@tanstack/query-sync-storage-persister

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

@tanstack/react-query

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

@tanstack/react-query-devtools

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

@tanstack/react-query-next-experimental

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

@tanstack/react-query-persist-client

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

@tanstack/solid-query

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

@tanstack/solid-query-devtools

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

@tanstack/solid-query-persist-client

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

@tanstack/svelte-query

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

@tanstack/svelte-query-devtools

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

@tanstack/svelte-query-persist-client

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

@tanstack/vue-query

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

@tanstack/vue-query-devtools

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

commit: 0fb91e6

@github-actions

github-actionsBot commented Apr 6, 2026

Copy link
Copy Markdown
Contributor

size-limit report 📦

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

@sukvvon
sukvvon marked this pull request as draft April 6, 2026 13:24
@sukvvonsukvvon changed the title test({react,preact}-query/infiniteQueryOptions): replace type annotation with 'as const'test({solid,svelte}-query/mutationOptions): replace 'toStrictEqual' with 'toBe' for identity checkApr 6, 2026
@sukvvon
sukvvon marked this pull request as ready for review April 6, 2026 13:38
@sukvvon
sukvvon merged commit 36fc645 into mainApr 6, 2026
8 checks passed
@sukvvon
sukvvon deleted the test/react-preact-query-infiniteQueryOptions-use-as-const branch April 6, 2026 13:43
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