Skip to content

test(*): rename 'console.warn' spies to 'consoleWarnMock' - #11645

Merged
sukvvon merged 1 commit into
mainfrom
test/rename-console-warn-spy-to-console-warn-mock
Sep 25, 2026
Merged

sukvvon merged 1 commit into
mainfrom
test/rename-console-warn-spy-to-console-warn-mock

Conversation

@sukvvon

@sukvvon sukvvon commented Sep 25, 2026 •

Copy link
Copy Markdown
Member

🎯 Changes

Renames every console.warn spy in the test suites to consoleWarnMock, so the name states which console method is mocked:

Before After Files
consoleMock consoleWarnMock vue-query: useIsFetching, useMutation, usePrefetchInfiniteQuery, usePrefetchQuery, useQueries, useQuery
consoleWarn consoleWarnMock query-persist-client-core: persist; react-query-persist-client: PersistQueryClientProvider; svelte-query-persist-client: PersistQueryClientProvider
warnSpy consoleWarnMock query-broadcast-client-experimental: index

The console.error spy named consoleMock in vue-query's useMutation test is left unchanged.

Renames only; no test behavior 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
    • Improved consistency in warning-related test cleanup and assertions. No application behavior changed.

@nx-cloud

nx-cloud Bot commented Sep 25, 2026 •

Copy link
Copy Markdown

View your CI Pipeline Execution ↗ for commit d5de707

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

☁️ Nx Cloud last updated this comment at 2026-09-25 15:15:36 UTC

@github-actions

Copy link
Copy Markdown
Contributor

🚀 Changeset Version Preview

1 package(s) bumped directly, 3 bumped as dependents.

🟩 Patch bumps

Package Version Reason
@tanstack/svelte-query 6.2.4 → 6.2.5 Changeset
@tanstack/svelte-query-devtools 6.2.4 → 6.2.5 Dependent
@tanstack/svelte-query-persist-client 6.2.4 → 6.2.5 Dependent
@tanstack/vue-query-devtools 6.2.4 → 6.2.5 Dependent

@coderabbitai

coderabbitai Bot commented Sep 25, 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: 0ddbd95c-8453-4753-82fa-3f1283a2240a

📥 Commits

Reviewing files that changed from the base of the PR and between 9ff2ee3 and d5de707.

📒 Files selected for processing (10)
  • packages/query-broadcast-client-experimental/src/__tests__/index.test.ts
  • packages/query-persist-client-core/src/__tests__/persist.test.ts
  • packages/react-query-persist-client/src/__tests__/PersistQueryClientProvider.test.tsx
  • packages/svelte-query-persist-client/tests/PersistQueryClientProvider.svelte.test.ts
  • packages/vue-query/src/__tests__/useIsFetching.test.ts
  • packages/vue-query/src/__tests__/useMutation.test.ts
  • packages/vue-query/src/__tests__/usePrefetchInfiniteQuery.test.ts
  • packages/vue-query/src/__tests__/usePrefetchQuery.test.ts
  • packages/vue-query/src/__tests__/useQueries.test.ts
  • packages/vue-query/src/__tests__/useQuery.test.ts

Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review.


📝 Walkthrough

Walkthrough

Tests in the broadcast, persistence, React, Svelte, and Vue Query packages rename local console.warn spy variables to consoleWarnMock. Warning assertions and spy restoration behavior remain unchanged.

Changes

Warning Spy Tests

Layer / File(s) Summary
Rename warning spies
packages/query-broadcast-client-experimental/src/__tests__/index.test.ts, packages/query-persist-client-core/src/__tests__/persist.test.ts, packages/react-query-persist-client/src/__tests__/PersistQueryClientProvider.test.tsx, packages/svelte-query-persist-client/tests/PersistQueryClientProvider.svelte.test.ts, packages/vue-query/src/__tests__/*
Warning-spy variables and their assertion and cleanup references now use consoleWarnMock. Expected warning messages and test behavior are unchanged.

Priority: ⬇️ Low

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

Change: Other

Merge Risk: ⚪ Minimal · up to d5de7

This change only renames local warning spies in tests without changing their behavior. No material merge risk is indicated.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes the main change: renaming console.warn spies to consoleWarnMock.
Description check ✅ Passed The description includes all required sections, explains the rename scope and motivation, records the checklist items, and identifies the change as dev-only with no release impact.
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.

@sukvvon sukvvon self-assigned this Sep 25, 2026
@pkg-pr-new

pkg-pr-new Bot commented Sep 25, 2026

Copy link
Copy Markdown
More templates

@tanstack/angular-query-experimental

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

@tanstack/eslint-plugin-query

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

@tanstack/lit-query

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

@tanstack/preact-query

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

@tanstack/preact-query-devtools

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

@tanstack/preact-query-persist-client

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

@tanstack/query-async-storage-persister

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

@tanstack/query-broadcast-client-experimental

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

@tanstack/query-core

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

@tanstack/query-devtools

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

@tanstack/query-persist-client-core

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

@tanstack/query-sync-storage-persister

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

@tanstack/react-query

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

@tanstack/react-query-devtools

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

@tanstack/react-query-next-experimental

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

@tanstack/react-query-persist-client

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

@tanstack/solid-query

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

@tanstack/solid-query-devtools

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

@tanstack/solid-query-persist-client

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

@tanstack/svelte-query

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

@tanstack/svelte-query-devtools

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

@tanstack/svelte-query-persist-client

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

@tanstack/vue-query

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

@tanstack/vue-query-devtools

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

commit: d5de707

@github-actions

Copy link
Copy Markdown
Contributor

size-limit report 📦

Path Size
react full 11.87 KB (0%)
react minimal 8.85 KB (0%)

@sukvvon
sukvvon merged commit fd64c13 into main Sep 25, 2026
9 checks passed
@sukvvon
sukvvon deleted the test/rename-console-warn-spy-to-console-warn-mock branch September 25, 2026 15:28
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