Skip to content

test(query-core/utils): split 'isValidTimeout' rejection cases into separate 'it' blocks#11071

Merged
sukvvon merged 1 commit into
mainfrom
test/query-core-utils-isvalidtimeout-split
Jul 17, 2026
Merged

test(query-core/utils): split 'isValidTimeout' rejection cases into separate 'it' blocks#11071
sukvvon merged 1 commit into
mainfrom
test/query-core-utils-isvalidtimeout-split

Conversation

@sukvvon

@sukvvon sukvvon commented Jul 17, 2026

Copy link
Copy Markdown
Member

🎯 Changes

Splits the single should reject invalid timeout values test (which bundled 5 expect assertions for -1, NaN, Infinity, '1000', and undefined) into 5 separate it blocks, so a failure identifies exactly which case broke instead of stopping at the first failed assertion.

✅ 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
    • Expanded timeout validation test coverage with separate checks for negative numbers, special numeric values, text inputs, and missing values.

@nx-cloud

nx-cloud Bot commented Jul 17, 2026

Copy link
Copy Markdown

View your CI Pipeline Execution ↗ for commit 9fa097b

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

☁️ Nx Cloud last updated this comment at 2026-07-17 04:13:23 UTC

@sukvvon sukvvon self-assigned this Jul 17, 2026
@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 Jul 17, 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: e75169a9-5606-4ece-a033-f027ad1c8f20

📥 Commits

Reviewing files that changed from the base of the PR and between 80b833e and 9fa097b.

📒 Files selected for processing (1)
  • packages/query-core/src/__tests__/utils.test.tsx

📝 Walkthrough

Walkthrough

The isValidTimeout invalid-input coverage was split from one combined test into five focused test cases covering negative numbers, NaN, Infinity, strings, and undefined.

Changes

Timeout validation tests

Layer / File(s) Summary
Focused invalid timeout cases
packages/query-core/src/__tests__/utils.test.tsx
Separate tests assert isValidTimeout(...) returns false for each invalid timeout input category.

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

Possibly related PRs

Suggested reviewers: whizzkid1452

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: splitting isValidTimeout rejection cases into separate test blocks.
Description check ✅ Passed The description follows the template and includes the changes, checklist, and release impact sections with relevant details.
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/query-core-utils-isvalidtimeout-split

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

@pkg-pr-new

pkg-pr-new Bot commented Jul 17, 2026

Copy link
Copy Markdown
More templates

@tanstack/angular-query-experimental

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

@tanstack/eslint-plugin-query

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

@tanstack/lit-query

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

@tanstack/preact-query

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

@tanstack/preact-query-devtools

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

@tanstack/preact-query-persist-client

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

@tanstack/query-async-storage-persister

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

@tanstack/query-broadcast-client-experimental

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

@tanstack/query-core

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

@tanstack/query-devtools

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

@tanstack/query-persist-client-core

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

@tanstack/query-sync-storage-persister

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

@tanstack/react-query

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

@tanstack/react-query-devtools

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

@tanstack/react-query-next-experimental

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

@tanstack/react-query-persist-client

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

@tanstack/solid-query

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

@tanstack/solid-query-devtools

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

@tanstack/solid-query-persist-client

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

@tanstack/svelte-query

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

@tanstack/svelte-query-devtools

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

@tanstack/svelte-query-persist-client

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

@tanstack/vue-query

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

@tanstack/vue-query-devtools

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

commit: 9fa097b

@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 97db5d2 into main Jul 17, 2026
9 checks passed
@sukvvon
sukvvon deleted the test/query-core-utils-isvalidtimeout-split branch July 17, 2026 04:26
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