Skip to content

test(lit-query): replace deprecated 'toThrowError' with 'toThrow'#10942

Merged
sukvvon merged 2 commits into
mainfrom
test/lit-query-replace-deprecated-vitest-aliases
Jun 14, 2026
Merged

test(lit-query): replace deprecated 'toThrowError' with 'toThrow'#10942
sukvvon merged 2 commits into
mainfrom
test/lit-query-replace-deprecated-vitest-aliases

Conversation

@sukvvon

@sukvvon sukvvon commented Jun 14, 2026

Copy link
Copy Markdown
Member

🎯 Changes

Replace the deprecated assertion alias toThrowError with its recommended counterpart toThrow across the lit-query test suite.

The alias is flagged @deprecated by @vitest/expect's type definitions, which point to the replacement used here:

  • toThrowErrortoThrow

Affected files:

  • context-provider.test.ts
  • mutation-controller.test.ts

✅ 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 assertions for query client context provider validation to align with current testing framework standards
    • Updated mutation controller validation tests to use consistent assertion methods
    • No changes to expected behavior or validation logic

@coderabbitai

coderabbitai Bot commented Jun 14, 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: 1217ab55-56fc-427f-92c4-ff4b7f0d4cc8

📥 Commits

Reviewing files that changed from the base of the PR and between e5161df and d5093c6.

📒 Files selected for processing (2)
  • packages/lit-query/src/tests/context-provider.test.ts
  • packages/lit-query/src/tests/mutation-controller.test.ts

📝 Walkthrough

Walkthrough

Two test files in packages/lit-query/src/tests/ have all toThrowError(...) assertions replaced with toThrow(...). The error matchers and test logic are unchanged.

Changes

Test Assertion Migration

Layer / File(s) Summary
toThrow migration across lit-query tests
packages/lit-query/src/tests/context-provider.test.ts, packages/lit-query/src/tests/mutation-controller.test.ts
Five assertions in context-provider.test.ts and one in mutation-controller.test.ts are updated from toThrowError(...) to toThrow(...) with identical regex matchers.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Poem

A bunny hopped through tests one day,
Found toThrowError in the way.
Swapped it out for toThrow instead,
Same regex, same path ahead.
Clean and simple, hip-hip-hooray! 🐇

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately and concisely describes the main change: replacing deprecated 'toThrowError' with 'toThrow' in lit-query tests.
Description check ✅ Passed The description follows the template structure, clearly explains the changes and motivation, and properly marks all applicable checklist items and release impact sections.
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.

✏️ 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/lit-query-replace-deprecated-vitest-aliases

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

@nx-cloud

nx-cloud Bot commented Jun 14, 2026

Copy link
Copy Markdown

View your CI Pipeline Execution ↗ for commit d5093c6

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

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

@github-actions

github-actions Bot commented Jun 14, 2026

Copy link
Copy Markdown
Contributor

🚀 Changeset Version Preview

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

@sukvvon sukvvon self-assigned this Jun 14, 2026
@pkg-pr-new

pkg-pr-new Bot commented Jun 14, 2026

Copy link
Copy Markdown
More templates

@tanstack/angular-query-experimental

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

@tanstack/eslint-plugin-query

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

@tanstack/lit-query

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

@tanstack/preact-query

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

@tanstack/preact-query-devtools

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

@tanstack/preact-query-persist-client

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

@tanstack/query-async-storage-persister

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

@tanstack/query-broadcast-client-experimental

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

@tanstack/query-core

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

@tanstack/query-devtools

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

@tanstack/query-persist-client-core

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

@tanstack/query-sync-storage-persister

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

@tanstack/react-query

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

@tanstack/react-query-devtools

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

@tanstack/react-query-next-experimental

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

@tanstack/react-query-persist-client

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

@tanstack/solid-query

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

@tanstack/solid-query-devtools

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

@tanstack/solid-query-persist-client

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

@tanstack/svelte-query

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

@tanstack/svelte-query-devtools

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

@tanstack/svelte-query-persist-client

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

@tanstack/vue-query

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

@tanstack/vue-query-devtools

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

commit: d5093c6

@github-actions

github-actions Bot commented Jun 14, 2026

Copy link
Copy Markdown
Contributor

size-limit report 📦

Path Size
react full 12.11 KB (0%)
react minimal 9.08 KB (0%)

@sukvvon sukvvon merged commit 2555dd0 into main Jun 14, 2026
9 checks passed
@sukvvon sukvvon deleted the test/lit-query-replace-deprecated-vitest-aliases branch June 14, 2026 10:52
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