Skip to content

test(angular-query-experimental): fix 'describe' nesting and naming in type test files#10411

Merged
sukvvon merged 5 commits intomainfrom
test/fix-describe-nesting-initialData
Apr 6, 2026
Merged

test(angular-query-experimental): fix 'describe' nesting and naming in type test files#10411
sukvvon merged 5 commits intomainfrom
test/fix-describe-nesting-initialData

Conversation

@sukvvon
Copy link
Copy Markdown
Collaborator

@sukvvon sukvvon commented Apr 6, 2026

🎯 Changes

  • Wrap inject-query.test-d.ts with top-level describe('injectQuery'), add describe('initialData') nesting, and nest Discriminated union return type inside
  • Wrap inject-mutation.test-d.ts with describe('injectMutation') and nest Discriminated union return type inside
  • Wrap inject-queries.test-d.ts with describe('injectQueries') and nest config object overload inside

✅ 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
    • Reorganized type test suite structure in the angular-query-experimental package with improved top-level grouping.
    • Added comprehensive type assertions covering edge cases including function-based configurations, structural sharing behavior, and discriminated union type narrowing.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Apr 6, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: b2b3607c-b10b-40a2-9d7e-67becf45ae9e

📥 Commits

Reviewing files that changed from the base of the PR and between 547a9c6 and 337be3b.

📒 Files selected for processing (2)
  • packages/angular-query-experimental/src/__tests__/inject-mutation.test-d.ts
  • packages/angular-query-experimental/src/__tests__/inject-queries.test-d.ts
✅ Files skipped from review due to trivial changes (2)
  • packages/angular-query-experimental/src/tests/inject-mutation.test-d.ts
  • packages/angular-query-experimental/src/tests/inject-queries.test-d.ts

📝 Walkthrough

Walkthrough

The PR restructures TypeScript type test files in angular-query-experimental by consolidating tests under unified top-level describe blocks, reorganizing existing test cases into nested structures, and adding new type-assertion cases for structural sharing, initialData function patterns, and discriminated union narrowing.

Changes

Cohort / File(s) Summary
Type test suite restructuring
packages/angular-query-experimental/src/__tests__/inject-query.test-d.ts, inject-mutation.test-d.ts, inject-queries.test-d.ts
Consolidated type tests under single top-level describe blocks; reorganized existing assertions into nested structures. inject-query.test-d.ts additionally introduces new test cases for structuralSharing (verifying oldData/newData are unknown with primitives) and explicit initialData function patterns (covering ALWAYS-returns-data, undefined unions, and isSuccess() narrowing). inject-mutation.test-d.ts and inject-queries.test-d.ts restructure without altering type assertions.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

Suggested labels

package: solid-query, package: svelte-query

Poem

🐰 Nested tests in rabbit holes so deep,
Type assertions in bundles we keep,
Discriminated unions now clearly seen,
The most organized test-d I've been!
Hopping through describe blocks with glee,
Code review now organized—wheee!

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title 'test(angular-query-experimental): fix 'describe' nesting and naming in type test files' clearly and concisely summarizes the main change: reorganizing describe blocks in three type test files to improve structural organization.
Description check ✅ Passed The description follows the template structure, clearly lists the three files modified and their changes, marks the checklist items appropriately (contributing guide followed, test not run locally, dev-only change), and provides sufficient context about the refactoring.
Docstring Coverage ✅ Passed No 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/fix-describe-nesting-initialData

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

@sukvvon sukvvon self-assigned this Apr 6, 2026
@nx-cloud
Copy link
Copy Markdown

nx-cloud bot commented Apr 6, 2026

View your CI Pipeline Execution ↗ for commit 337be3b

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

☁️ Nx Cloud last updated this comment at 2026-04-06 14:42:51 UTC

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 6, 2026

🚀 Changeset Version Preview

No changeset entries found. Merging this PR will not cause a version bump for any packages.

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new bot commented Apr 6, 2026

More templates

@tanstack/angular-query-experimental

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

@tanstack/eslint-plugin-query

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

@tanstack/preact-query

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

@tanstack/preact-query-devtools

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

@tanstack/preact-query-persist-client

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

@tanstack/query-async-storage-persister

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

@tanstack/query-broadcast-client-experimental

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

@tanstack/query-core

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

@tanstack/query-devtools

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

@tanstack/query-persist-client-core

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

@tanstack/query-sync-storage-persister

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

@tanstack/react-query

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

@tanstack/react-query-devtools

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

@tanstack/react-query-next-experimental

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

@tanstack/react-query-persist-client

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

@tanstack/solid-query

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

@tanstack/solid-query-devtools

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

@tanstack/solid-query-persist-client

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

@tanstack/svelte-query

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

@tanstack/svelte-query-devtools

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

@tanstack/svelte-query-persist-client

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

@tanstack/vue-query

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

@tanstack/vue-query-devtools

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

commit: 337be3b

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 6, 2026

size-limit report 📦

Path Size
react full 11.98 KB (0%)
react minimal 9.01 KB (0%)

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@packages/angular-query-experimental/src/__tests__/inject-query.test-d.ts`:
- Line 37: Update the test title string in the it(...) block that currently
reads "should be possible to define a different TData than TQueryFnData using
select with queryOptions spread into useQuery" to replace "useQuery" with
"injectQuery" so the test description matches the actual API under test (the
it(...) block for injectQuery in the inject-query.test-d.ts file).
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 3d253a68-d7f4-4f43-9b87-c391247cbf74

📥 Commits

Reviewing files that changed from the base of the PR and between fc35bbf and 547a9c6.

📒 Files selected for processing (3)
  • packages/angular-query-experimental/src/__tests__/inject-query.test-d.ts
  • packages/solid-query/src/__tests__/useQuery.test-d.tsx
  • packages/svelte-query/tests/createQuery.test-d.ts

expectTypeOf(data).toEqualTypeOf<Signal<{ wow: boolean }>>()
})

it('should be possible to define a different TData than TQueryFnData using select with queryOptions spread into useQuery', () => {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Fix test title naming mismatch (useQueryinjectQuery).

Line 37 mentions useQuery, but this suite validates injectQuery; update the title to avoid misleading test output.

✏️ Suggested text fix
-      it('should be possible to define a different TData than TQueryFnData using select with queryOptions spread into useQuery', () => {
+      it('should be possible to define a different TData than TQueryFnData using select with queryOptions spread into injectQuery', () => {
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
it('should be possible to define a different TData than TQueryFnData using select with queryOptions spread into useQuery', () => {
it('should be possible to define a different TData than TQueryFnData using select with queryOptions spread into injectQuery', () => {
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/angular-query-experimental/src/__tests__/inject-query.test-d.ts` at
line 37, Update the test title string in the it(...) block that currently reads
"should be possible to define a different TData than TQueryFnData using select
with queryOptions spread into useQuery" to replace "useQuery" with "injectQuery"
so the test description matches the actual API under test (the it(...) block for
injectQuery in the inject-query.test-d.ts file).

…nject-queries.test-d.ts' and 'inject-mutation.test-d.ts'
@sukvvon sukvvon changed the title test({solid,svelte,angular}-query): add missing 'initialData' describe nesting and wrap with top-level describe test({solid,svelte,angular}-query): fix 'describe' nesting and naming in type test files Apr 6, 2026
@sukvvon sukvvon changed the title test({solid,svelte,angular}-query): fix 'describe' nesting and naming in type test files test(angular-query-experimental): fix 'describe' nesting and naming in type test files Apr 6, 2026
@sukvvon sukvvon merged commit 2a4fc9f into main Apr 6, 2026
8 checks passed
@sukvvon sukvvon deleted the test/fix-describe-nesting-initialData branch April 6, 2026 14:46
Sign up for free to 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