Skip to content

test(svelte-query): remove blank lines between actions, waits and their assertions - #11660

Open
sukvvon wants to merge 2 commits into
mainfrom
test/svelte-query-blank-lines
Open

sukvvon wants to merge 2 commits into
mainfrom
test/svelte-query-blank-lines

Conversation

@sukvvon

@sukvvon sukvvon commented Sep 26, 2026 •

Copy link
Copy Markdown
Member

🎯 Changes

Adjusts blank lines in svelte-query's runtime tests:

  • A wait (await vi.advanceTimersByTimeAsync(...), flushSync(), await promise) directly followed by its assertions
  • An assertion directly followed by the next wait
  • A user action (fireEvent.click(...), result[0].refetch(), queries.value = [...], resolving a pending promise) directly followed by its wait
  • A blank line before query.refetch() that follows the assertions on the initial state

Blank lines after setup (render(...), $effect(...), createQuery(...), setTimeout(...)) are kept.

Blank lines only; no code changes.

✅ Checklist

  • I have followed the steps in the Contributing guide.
  • I have tested code changes locally with pnpm run test:pr, or these tests do not apply to this pull request.
  • I have followed the AI contribution policy and fully understand the code in this pull request, including any code generated with AI assistance.

🚀 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 mutation test coverage for callback behavior, optimistic updates, client changes, and concurrent mutations.
    • Adjusted timing in infinite-query tests.
    • Made whitespace-only changes to query and mutation-state tests.

@sukvvon sukvvon self-assigned this Sep 26, 2026
@nx-cloud

nx-cloud Bot commented Sep 26, 2026 •

Copy link
Copy Markdown

View your CI Pipeline Execution ↗ for commit 755b7e0


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

@coderabbitai

coderabbitai Bot commented Sep 26, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository: TanStack/query/.coderabbit.yaml

Review profile: CHILL

Plan: Advanced

Run ID: b68dce4a-9cab-4d47-98c1-c257ea4884c6

📥 Commits

Reviewing files that changed from the base of the PR and between 2dbddfb and 0e4b329.

📒 Files selected for processing (5)
  • packages/svelte-query/tests/createInfiniteQuery/createInfiniteQuery.svelte.test.ts
  • packages/svelte-query/tests/createMutation/createMutation.svelte.test.ts
  • packages/svelte-query/tests/createQueries/createQueries.svelte.test.ts
  • packages/svelte-query/tests/createQuery/createQuery.svelte.test.ts
  • packages/svelte-query/tests/useMutationState/useMutationState.svelte.test.ts
💤 Files with no reviewable changes (4)
  • packages/svelte-query/tests/createInfiniteQuery/createInfiniteQuery.svelte.test.ts
  • packages/svelte-query/tests/createQueries/createQueries.svelte.test.ts
  • packages/svelte-query/tests/useMutationState/useMutationState.svelte.test.ts
  • packages/svelte-query/tests/createMutation/createMutation.svelte.test.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 6 remain after this review.


📝 Walkthrough

Walkthrough

The Svelte Query tests add mutation callback, context, cache, and concurrency checks. Infinite-query tests add timer advances before state checks. Other query test edits remove whitespace without changing test operations or expectations.

Changes

Svelte Query tests

Layer / File(s) Summary
Mutation callback coverage
packages/svelte-query/tests/createMutation/createMutation.svelte.test.ts
Tests check per-call and hook-level callback behavior, callback order, awaited callbacks, and mutateAsync results or errors.
Mutation state and concurrent calls
packages/svelte-query/tests/createMutation/createMutation.svelte.test.ts
Tests check client changes, optimistic cache values, callback context, invalidation, parallel results and failures, and concurrent mutation results.
Query test timing and whitespace
packages/svelte-query/tests/createInfiniteQuery/createInfiniteQuery.svelte.test.ts, packages/svelte-query/tests/createQueries/createQueries.svelte.test.ts, packages/svelte-query/tests/createQuery/createQuery.svelte.test.ts, packages/svelte-query/tests/useMutationState/useMutationState.svelte.test.ts
Infinite-query tests advance fake timers before state checks. The other listed test files remove blank lines without changing test operations or expectations.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Other

Merge Risk: ⚪ Minimal · up to 0e4b3

The changes are confined to Svelte Query tests, and no actionable merge risk is established by the supplied context.

Architecture Summary

Architecture risk: 🔵 Low · up to 0e4b3

The change affects 1 system.

Changed systems: packages/svelte-query

Architecture concerns
No architecture-level concerns identified.

Review details

Systems and components

  • observed — packages/svelte-query (library) was modified; 5 changed files map to changed impact.

Before / after behavior

  • observed — Modified behavior in packages/svelte-query/tests/createInfiniteQuery/createInfiniteQuery.svelte.test.ts: The initial-data success test now advances fake timers after its immediate success-status assertion before checking the observed states.
  • observed — Modified behavior in packages/svelte-query/tests/createInfiniteQuery/createInfiniteQuery.svelte.test.ts: The refetch-error test now advances fake timers before asserting that the initial pages remain visible and the error state is set.
  • observed — Modified behavior in packages/svelte-query/tests/createInfiniteQuery/createInfiniteQuery.svelte.test.ts: The skipToken test now advances fake timers before asserting that the query function has not run and the query remains unfetched.
  • observed — Modified behavior in packages/svelte-query/tests/createMutation/createMutation.svelte.test.ts: The callback tests check that per-call success, error, and settled callbacks run when no hook-level callbacks are configured, including cases where only one callback is supplied; mutateAsync expectations also check the resulting callback sequence.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description check ✅ Passed The description follows the repository template. It explains the spacing changes, states that no code behavior changes, and completes the checklist and release-impact sections.
Title check ✅ Passed The title clearly and concisely describes the primary change: removing blank lines between test actions, waits, and assertions.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 1…
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
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@pkg-pr-new

pkg-pr-new Bot commented Sep 26, 2026

Copy link
Copy Markdown
More templates

@tanstack/angular-query-experimental

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

@tanstack/eslint-plugin-query

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

@tanstack/lit-query

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

@tanstack/preact-query

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

@tanstack/preact-query-devtools

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

@tanstack/preact-query-persist-client

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

@tanstack/query-async-storage-persister

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

@tanstack/query-broadcast-client-experimental

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

@tanstack/query-core

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

@tanstack/query-devtools

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

@tanstack/query-persist-client-core

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

@tanstack/query-sync-storage-persister

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

@tanstack/react-query

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

@tanstack/react-query-devtools

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

@tanstack/react-query-next-experimental

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

@tanstack/react-query-persist-client

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

@tanstack/solid-query

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

@tanstack/solid-query-devtools

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

@tanstack/solid-query-persist-client

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

@tanstack/svelte-query

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

@tanstack/svelte-query-devtools

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

@tanstack/svelte-query-persist-client

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

@tanstack/vue-query

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

@tanstack/vue-query-devtools

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

commit: 0e4b329

@github-actions

Copy link
Copy Markdown
Contributor

size-limit report 📦

Path Size
react full 11.73 KB (0%)
react minimal 8.58 KB (0%)

This branch has not been deployed

No deployments
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