Skip to content

test(query-core/queriesObserver): add test for 'getQueries' method#10247

Open
sukvvon wants to merge 1 commit intoTanStack:mainfrom
sukvvon:test/query-core-queriesObserver-getQueries
Open

test(query-core/queriesObserver): add test for 'getQueries' method#10247
sukvvon wants to merge 1 commit intoTanStack:mainfrom
sukvvon:test/query-core-queriesObserver-getQueries

Conversation

@sukvvon
Copy link
Contributor

@sukvvon sukvvon commented Mar 6, 2026

🎯 Changes

Add a test for queriesObserver.ts line 165 — the getQueries() method that returns current queries from internal observers.

✅ 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

  • New Features
    • Added functionality to retrieve the current list of queries.

@changeset-bot
Copy link

changeset-bot bot commented Mar 6, 2026

⚠️ No Changeset found

Latest commit: a8c3217

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

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 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: 5887efa1-2536-4b0c-a23d-b240ec8b2a6a

📥 Commits

Reviewing files that changed from the base of the PR and between fe25edc and a8c3217.

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

📝 Walkthrough

Walkthrough

A new getQueries() method was added to the QueriesObserver class, enabling retrieval of current queries. A corresponding test case was introduced to verify the method returns query entries with correct query keys.

Changes

Cohort / File(s) Summary
QueriesObserver getQueries Method
packages/query-core/src/queriesObserver.ts, packages/query-core/src/__tests__/queriesObserver.test.tsx
Added getQueries() method to QueriesObserver class and new test case validating the method returns current queries with correct queryKey values.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Poem

🐰 A query observer springs to life,
With getQueries() to end the strife,
No more searching through the dark,
Just call the method, leave your mark! ✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The PR title accurately describes the main change: adding a test for the 'getQueries' method in queriesObserver, which is confirmed by the raw summary and code changes.
Description check ✅ Passed The PR description includes all required template sections: Changes (with clear explanation of what's being tested), completed Checklist items, and Release Impact (correctly marked as dev-only).
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 unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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

@nx-cloud
Copy link

nx-cloud bot commented Mar 6, 2026

View your CI Pipeline Execution ↗ for commit a8c3217

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

☁️ Nx Cloud last updated this comment at 2026-03-06 02:59:24 UTC

@pkg-pr-new
Copy link

pkg-pr-new bot commented Mar 6, 2026

More templates

@tanstack/angular-query-experimental

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

@tanstack/eslint-plugin-query

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

@tanstack/preact-query

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

@tanstack/preact-query-devtools

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

@tanstack/preact-query-persist-client

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

@tanstack/query-async-storage-persister

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

@tanstack/query-broadcast-client-experimental

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

@tanstack/query-core

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

@tanstack/query-devtools

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

@tanstack/query-persist-client-core

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

@tanstack/query-sync-storage-persister

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

@tanstack/react-query

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

@tanstack/react-query-devtools

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

@tanstack/react-query-next-experimental

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

@tanstack/react-query-persist-client

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

@tanstack/solid-query

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

@tanstack/solid-query-devtools

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

@tanstack/solid-query-persist-client

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

@tanstack/svelte-query

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

@tanstack/svelte-query-devtools

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

@tanstack/svelte-query-persist-client

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

@tanstack/vue-query

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

@tanstack/vue-query-devtools

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

commit: e6a0195

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