Skip to content

test(vue-query/vueQueryPlugin): rename 'testIf' helper to 'itIf' for consistency with 'it' convention#10533

Merged
sukvvon merged 2 commits intomainfrom
test/vue-query-rename-testIf-to-itIf
Apr 20, 2026
Merged

test(vue-query/vueQueryPlugin): rename 'testIf' helper to 'itIf' for consistency with 'it' convention#10533
sukvvon merged 2 commits intomainfrom
test/vue-query-rename-testIf-to-itIf

Conversation

@sukvvon
Copy link
Copy Markdown
Collaborator

@sukvvon sukvvon commented Apr 20, 2026

🎯 Changes

Renames the testIf helper in vueQueryPlugin.test.ts to itIf to align with the it convention enforced project-wide by vitest/consistent-test-it.

Files

  • packages/vue-query/src/__tests__/vueQueryPlugin.test.ts — helper definition + 13 usages
  • eslint.config.jsadditionalTestBlockFunctions: ['testIf']['itIf']

Why

After #10528 enforced { fn: 'it', withinDescribe: 'it' } across the repo, a helper named testIf that internally returns it / it.skip reads inconsistently. The rename keeps the naming aligned with:

  • the helper's actual return value (it / it.skip)
  • vitest's own it.runIf / it.skipIf API
  • the project-wide it convention

The helper itself is kept (not replaced with it.runIf) because it also serves a second purpose: avoiding vitest/no-identical-title false positives when the same title is intentionally used twice for isVue2 and isVue3 branches in the same describe block.

Verification

  • test:eslint in @tanstack/vue-query: 0 errors
  • test:lib in @tanstack/vue-query: 289 passed, 6 skipped (unchanged from main)

✅ 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

    • Updated test helper function naming and refactored test invocations for improved code consistency.
  • Chores

    • Updated ESLint configuration for test validation rules.

Note: This release contains internal maintenance updates with no user-facing changes.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 20, 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: b1828c45-8afd-41ee-946c-05945af063a6

📥 Commits

Reviewing files that changed from the base of the PR and between fc0462b and 23d98c0.

📒 Files selected for processing (2)
  • eslint.config.js
  • packages/vue-query/src/__tests__/vueQueryPlugin.test.ts

📝 Walkthrough

Walkthrough

A test helper function is renamed from testIf to itIf across the codebase. The ESLint configuration is updated to reflect the new function name in the Vitest rule, and the test file is refactored to use itIf with some cases simplified to single-line invocations.

Changes

Cohort / File(s) Summary
ESLint Configuration
eslint.config.js
Updated Vitest ESLint rule vitest/no-standalone-expect by changing additionalTestBlockFunctions from ['testIf'] to ['itIf'].
Test Helper Migration
packages/vue-query/src/__tests__/vueQueryPlugin.test.ts
Replaced all occurrences of testIf helper with itIf, and refactored several multi-line test invocations to single-line format while preserving test behavior and assertions.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐰 A hop and a skip, we renamed with care,
From testIf to itIf everywhere!
The linter now knows of this change so sweet,
Our tests are condensed on a single-line beat,
Configuration and code, now perfectly neat! ✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main change: renaming the 'testIf' helper to 'itIf' for consistency with the project's 'it' convention.
Description check ✅ Passed The description is comprehensive and complete, covering all required sections from the template with clear explanations, verification results, and proper checklist completion.
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/vue-query-rename-testIf-to-itIf

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

@nx-cloud
Copy link
Copy Markdown

nx-cloud Bot commented Apr 20, 2026

View your CI Pipeline Execution ↗ for commit 23d98c0

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

☁️ Nx Cloud last updated this comment at 2026-04-20 15:52:54 UTC

@sukvvon sukvvon self-assigned this Apr 20, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 20, 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 20, 2026

More templates

@tanstack/angular-query-experimental

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

@tanstack/eslint-plugin-query

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

@tanstack/preact-query

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

@tanstack/preact-query-devtools

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

@tanstack/preact-query-persist-client

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

@tanstack/query-async-storage-persister

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

@tanstack/query-broadcast-client-experimental

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

@tanstack/query-core

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

@tanstack/query-devtools

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

@tanstack/query-persist-client-core

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

@tanstack/query-sync-storage-persister

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

@tanstack/react-query

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

@tanstack/react-query-devtools

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

@tanstack/react-query-next-experimental

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

@tanstack/react-query-persist-client

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

@tanstack/solid-query

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

@tanstack/solid-query-devtools

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

@tanstack/solid-query-persist-client

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

@tanstack/svelte-query

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

@tanstack/svelte-query-devtools

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

@tanstack/svelte-query-persist-client

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

@tanstack/vue-query

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

@tanstack/vue-query-devtools

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

commit: 23d98c0

@github-actions
Copy link
Copy Markdown
Contributor

size-limit report 📦

Path Size
react full 11.99 KB (0%)
react minimal 9.02 KB (0%)

@sukvvon sukvvon merged commit cd6a274 into main Apr 20, 2026
8 checks passed
@sukvvon sukvvon deleted the test/vue-query-rename-testIf-to-itIf branch April 20, 2026 15:58
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