Skip to content

test(lit-query/createInfiniteQueryController): add type tests - #11766

Merged
sukvvon merged 6 commits into
mainfrom
test/lit-query-create-infinite-query-controller-type-tests
Oct 3, 2026
Merged

sukvvon merged 6 commits into
mainfrom
test/lit-query-create-infinite-query-controller-type-tests

Conversation

@sukvvon

@sukvvon sukvvon commented Sep 30, 2026 •

Copy link
Copy Markdown
Member

🎯 Changes

Adds createInfiniteQueryController.test-d.ts with 10 type tests:

  • pageParam typed by initialPageParam, and direction in the query function context
  • paginated data without select, and data transformed by select
  • typed arguments of getNextPageParam and getPreviousPageParam
  • error booleans typed as boolean
  • data defaulting to InfiniteData<TQueryFnData> for CreateInfiniteQueryOptions
  • return types of the controller's refetch, fetchNextPage, and fetchPreviousPage

✅ 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
    • Added type-level coverage for infinite query pagination, selected results, page callbacks, error flags, and default data types.

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

nx-cloud Bot commented Sep 30, 2026 •

Copy link
Copy Markdown

View your CI Pipeline Execution ↗ for commit 0bd493c

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

☁️ Nx Cloud last updated this comment at 2026-10-03 06:49:59 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 30, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

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

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

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: 2644cfd9-c078-44a2-84c3-0025a691cd60
📥 Commits

Reviewing files that changed from the base of the PR and between a979865 and 0bd493c.

📒 Files selected for processing (1)
  • packages/lit-query/src/__tests__/createInfiniteQueryController.test-d.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • packages/lit-query/src/tests/createInfiniteQueryController.test-d.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 pull request adds type-level tests for createInfiniteQueryController. The assertions cover page parameter and direction types, query data and selection results, pagination callback arguments, error flags, default option data, and fetch method return types.

Changes

Controller type coverage

Layer / File(s) Summary
Infinite query controller type assertions
packages/lit-query/src/__tests__/createInfiniteQueryController.test-d.ts
Adds assertions for inferred page parameters, selected and unselected query data, pagination callback arguments, error flags, default option data, and return types for refetch, fetchNextPage, and fetchPreviousPage.

Priority: ⬇️ Low

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

Change: Other

Merge Risk: ⚪ Minimal · up to 0bd49

The added type tests cover the intended controller types, and no actionable merge risk was identified.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely identifies the addition of type tests for createInfiniteQueryController.
Description check ✅ Passed The description includes the required Changes, Checklist, and Release Impact sections. It summarizes the tests and marks the applicable checklist items.
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
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Autopilot is currently an internal CodeRabbit preview.


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 30, 2026 •

Copy link
Copy Markdown
More templates

@tanstack/angular-query-experimental

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

@tanstack/eslint-plugin-query

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

@tanstack/lit-query

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

@tanstack/preact-query

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

@tanstack/preact-query-devtools

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

@tanstack/preact-query-persist-client

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

@tanstack/query-async-storage-persister

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

@tanstack/query-broadcast-client-experimental

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

@tanstack/query-core

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

@tanstack/query-devtools

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

@tanstack/query-persist-client-core

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

@tanstack/query-sync-storage-persister

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

@tanstack/react-query

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

@tanstack/react-query-devtools

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

@tanstack/react-query-next-experimental

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

@tanstack/react-query-persist-client

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

@tanstack/solid-query

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

@tanstack/solid-query-devtools

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

@tanstack/solid-query-persist-client

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

@tanstack/svelte-query

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

@tanstack/svelte-query-devtools

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

@tanstack/svelte-query-persist-client

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

@tanstack/vue-query

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

@tanstack/vue-query-devtools

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

commit: 0bd493c

@github-actions

Copy link
Copy Markdown
Contributor

size-limit report 📦

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

@changeset-bot

changeset-bot Bot commented Oct 3, 2026 •

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 0bd493c

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

@sukvvon
sukvvon merged commit 28afaa0 into main Oct 3, 2026
9 checks passed
@sukvvon
sukvvon deleted the test/lit-query-create-infinite-query-controller-type-tests branch October 3, 2026 06:52
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