Skip to content

test(svelte-query/containers): add test for deleting a non-existent property#10992

Merged
sukvvon merged 1 commit into
mainfrom
test/svelte-query-containers-delete
Jun 27, 2026
Merged

test(svelte-query/containers): add test for deleting a non-existent property#10992
sukvvon merged 1 commit into
mainfrom
test/svelte-query-containers-delete

Conversation

@sukvvon

@sukvvon sukvvon commented Jun 27, 2026

Copy link
Copy Markdown
Member

🎯 Changes

Add a unit test for createRawRef in packages/svelte-query/src/containers.svelte.ts covering the deleteProperty trap when the property does not exist.

This complements the existing deleteProperty coverage (deleting an existing key) by asserting that deleting a non-existent property returns false and leaves the reference unchanged, matching the file's per-trap test pattern (has, ownKeys, getOwnPropertyDescriptor).

✅ 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 coverage for deleting a non-existent property from a reference, confirming the delete operation fails gracefully and leaves the reference unchanged.

@coderabbitai

coderabbitai Bot commented Jun 27, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: d31fe343-f4b9-4802-b957-5c1a401a1bbf

📥 Commits

Reviewing files that changed from the base of the PR and between e6ad3fc and 6539a6f.

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

📝 Walkthrough

Walkthrough

Adds a test covering Reflect.deleteProperty on a raw ref when the key is missing, asserting a false result and unchanged contents.

Changes

Raw ref delete-property behavior

Layer / File(s) Summary
Missing-key delete assertion
packages/svelte-query/tests/containers.svelte.test.ts
Adds a createRawRef test that deletes a non-existent property with Reflect.deleteProperty, checks the return value, and verifies the ref remains { a: 1, b: 2 }.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Poem

I hopped through the tests with a twitchy nose,
Found a missing key where the bunny code goes.
false was the answer, the ref stayed neat,
Two little carrots: { a: 1, b: 2 } complete. 🐇

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly matches the change: a new test for deleting a non-existent property in svelte-query containers.
Description check ✅ Passed The description follows the template and includes changes, checklist, and release impact with the required items filled out.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ 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-containers-delete

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

@sukvvon sukvvon self-assigned this Jun 27, 2026
@nx-cloud

nx-cloud Bot commented Jun 27, 2026

Copy link
Copy Markdown

View your CI Pipeline Execution ↗ for commit 6539a6f

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

☁️ Nx Cloud last updated this comment at 2026-06-27 09:20:35 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

pkg-pr-new Bot commented Jun 27, 2026

Copy link
Copy Markdown
More templates

@tanstack/angular-query-experimental

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

@tanstack/eslint-plugin-query

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

@tanstack/lit-query

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

@tanstack/preact-query

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

@tanstack/preact-query-devtools

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

@tanstack/preact-query-persist-client

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

@tanstack/query-async-storage-persister

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

@tanstack/query-broadcast-client-experimental

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

@tanstack/query-core

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

@tanstack/query-devtools

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

@tanstack/query-persist-client-core

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

@tanstack/query-sync-storage-persister

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

@tanstack/react-query

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

@tanstack/react-query-devtools

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

@tanstack/react-query-next-experimental

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

@tanstack/react-query-persist-client

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

@tanstack/solid-query

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

@tanstack/solid-query-devtools

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

@tanstack/solid-query-persist-client

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

@tanstack/svelte-query

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

@tanstack/svelte-query-devtools

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

@tanstack/svelte-query-persist-client

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

@tanstack/vue-query

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

@tanstack/vue-query-devtools

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

commit: 6539a6f

@github-actions

Copy link
Copy Markdown
Contributor

size-limit report 📦

Path Size
react full 12.13 KB (0%)
react minimal 9.08 KB (0%)

@sukvvon sukvvon merged commit 0b6b827 into main Jun 27, 2026
9 checks passed
@sukvvon sukvvon deleted the test/svelte-query-containers-delete branch June 27, 2026 09:21
Sign up for free to 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