Skip to content

test(svelte-query): replace 'toBeDefined' with exact-value assertion - #11124

Merged
sukvvon merged 1 commit into
mainfrom
test/svelte-query-exact-assertions
Jul 26, 2026
Merged

test(svelte-query): replace 'toBeDefined' with exact-value assertion#11124
sukvvon merged 1 commit into
mainfrom
test/svelte-query-exact-assertions

Conversation

@sukvvon

@sukvvonsukvvon commented Jul 26, 2026

Copy link
Copy Markdown
Member

🎯 Changes

Continues the recent test-quality series (e.g. #11105, #11093) by converting the toBeDefined() assertion in svelte-query tests to an exact assertion:

  • QueryClientProvider.svelte.test.ts — the cache presence check now asserts the exact cached value (?.state.data) produced by the test's queryFn, confirmed by the rendered Data: test text.

✅ Checklist

Local verification detail: vitest run on the full package — 168 tests passed, no type errors.

🚀 Release Impact

  • This change is docs/CI/dev-only (no release).

Summary by CodeRabbit

  • Tests
    • Strengthened validation of cached query data to confirm it contains the expected value.

@nx-cloud

nx-cloudBot commented Jul 26, 2026

Copy link
Copy Markdown

View your CI Pipeline Execution ↗ for commit 09aa511

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

☁️ Nx Cloud last updated this comment at 2026-07-26 15:53:10 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.

@sukvvonsukvvon changed the title test(svelte-query): assert exact values instead of loose matcherstest(svelte-query): replace 'toBeDefined()' with exact-value assertionJul 26, 2026
@coderabbitai

coderabbitaiBot commented Jul 26, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

The QueryClientProvider test now verifies that the cached ['hello'] query contains 'test', rather than only confirming that the cache entry exists.

Changes

QueryClientProvider cache validation

Layer / File(s)Summary
Strengthen cached data assertion
packages/svelte-query/tests/QueryClientProvider/QueryClientProvider.svelte.test.ts
The cache assertion now checks that the query’s state.data equals 'test'.

Estimated code review effort: 1 (Trivial) | ~2 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check nameStatusExplanation
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.
Title check✅ PassedThe title clearly and concisely describes the test assertion change in svelte-query.
Description check✅ PassedThe description follows the template and includes changes, checklist status, and release impact with useful verification details.
✨ 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-exact-assertions

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

@sukvvonsukvvon changed the title test(svelte-query): replace 'toBeDefined()' with exact-value assertiontest(svelte-query): replace 'toBeDefined' with exact-value assertionJul 26, 2026
@pkg-pr-new

Copy link
Copy Markdown
More templates

@tanstack/angular-query-experimental

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

@tanstack/eslint-plugin-query

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

@tanstack/lit-query

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

@tanstack/preact-query

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

@tanstack/preact-query-devtools

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

@tanstack/preact-query-persist-client

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

@tanstack/query-async-storage-persister

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

@tanstack/query-broadcast-client-experimental

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

@tanstack/query-core

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

@tanstack/query-devtools

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

@tanstack/query-persist-client-core

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

@tanstack/query-sync-storage-persister

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

@tanstack/react-query

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

@tanstack/react-query-devtools

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

@tanstack/react-query-next-experimental

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

@tanstack/react-query-persist-client

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

@tanstack/solid-query

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

@tanstack/solid-query-devtools

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

@tanstack/solid-query-persist-client

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

@tanstack/svelte-query

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

@tanstack/svelte-query-devtools

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

@tanstack/svelte-query-persist-client

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

@tanstack/vue-query

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

@tanstack/vue-query-devtools

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

commit: 09aa511

@github-actions

Copy link
Copy Markdown
Contributor

size-limit report 📦

PathSize
react full12.15 KB (0%)
react minimal9.1 KB (0%)

@sukvvonsukvvon self-assigned this Jul 26, 2026
@sukvvon
sukvvon merged commit 5972ae6 into mainJul 26, 2026
9 checks passed
@sukvvon
sukvvon deleted the test/svelte-query-exact-assertions branch July 26, 2026 15:58
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