Skip to content

test(angular-query): replace 'toBeDefined' with exact-value assertion - #11121

Merged
sukvvon merged 1 commit into
mainfrom
test/angular-query-exact-assertions
Jul 26, 2026
Merged

test(angular-query): replace 'toBeDefined' with exact-value assertion#11121
sukvvon merged 1 commit into
mainfrom
test/angular-query-exact-assertions

Conversation

@sukvvon

@sukvvonsukvvon commented Jul 26, 2026

Copy link
Copy Markdown
Member

🎯 Changes

Continues the recent test-quality series (e.g. #11105, #11093) by converting the toBeDefined() assertion in angular-query-experimental tests to an exact assertion:

  • inject-mutation.test.ts — the redundant expect(mutation).toBeDefined() existence check is removed; the next line already asserts ?.options.mutationKey on the same value via optional chaining, which fails on undefined either way.

After this, grep -rE 'toBeTruthy\(\)|toBeFalsy\(\)|toBeDefined\(\)' packages/angular-query-experimental/src returns no matches.

✅ Checklist

Local verification detail: vitest run on the edited file — 28 tests passed, no type errors.

🚀 Release Impact

  • This change is docs/CI/dev-only (no release).

Summary by CodeRabbit

  • Tests
    • Improved test assertion handling for required signal inputs without changing user-facing functionality.

@nx-cloud

nx-cloudBot commented Jul 26, 2026

Copy link
Copy Markdown

View your CI Pipeline Execution ↗ for commit 5654990

CommandStatusDurationResult
nx affected --targets=test:sherif,test:knip,tes...✅ Succeeded5m 20sView ↗
nx run-many --target=build --exclude=examples/*...✅ Succeeded9sView ↗

☁️ Nx Cloud last updated this comment at 2026-07-26 15:53:25 UTC

@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

coderabbitaiBot commented Jul 26, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

The required signal inputs test now directly checks the optional mutation key with strict equality, removing the preceding definedness assertion and non-null access.

Changes

Mutation test assertion

Layer / File(s)Summary
Update mutation key assertion
packages/angular-query-experimental/src/__tests__/inject-mutation.test.ts
The test compares mutation?.options.mutationKey directly with ['fake', 'value'].

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

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check nameStatusExplanation
Docstring Coverage✅ PassedNo functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check✅ PassedCheck skipped because no linked issues were found for this pull request.
Out of Scope Changes check✅ PassedCheck skipped because no linked issues were found for this pull request.
Title check✅ PassedThe title accurately summarizes the test-only assertion change in angular-query-experimental.
Description check✅ PassedThe description matches the template and includes changes, checklist items, local verification, and release impact.
✨ 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/angular-query-exact-assertions

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

@sukvvonsukvvon changed the title test(angular-query): assert exact values instead of loose matcherstest(angular-query): replace 'toBeDefined()' with exact-value assertionJul 26, 2026
@pkg-pr-new

Copy link
Copy Markdown
More templates

@tanstack/angular-query-experimental

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

@tanstack/eslint-plugin-query

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

@tanstack/lit-query

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

@tanstack/preact-query

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

@tanstack/preact-query-devtools

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

@tanstack/preact-query-persist-client

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

@tanstack/query-async-storage-persister

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

@tanstack/query-broadcast-client-experimental

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

@tanstack/query-core

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

@tanstack/query-devtools

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

@tanstack/query-persist-client-core

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

@tanstack/query-sync-storage-persister

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

@tanstack/react-query

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

@tanstack/react-query-devtools

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

@tanstack/react-query-next-experimental

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

@tanstack/react-query-persist-client

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

@tanstack/solid-query

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

@tanstack/solid-query-devtools

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

@tanstack/solid-query-persist-client

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

@tanstack/svelte-query

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

@tanstack/svelte-query-devtools

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

@tanstack/svelte-query-persist-client

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

@tanstack/vue-query

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

@tanstack/vue-query-devtools

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

commit: 5654990

@github-actions

Copy link
Copy Markdown
Contributor

size-limit report 📦

PathSize
react full12.15 KB (0%)
react minimal9.1 KB (0%)

@sukvvonsukvvon changed the title test(angular-query): replace 'toBeDefined()' with exact-value assertiontest(angular-query): replace 'toBeDefined' with exact-value assertionJul 26, 2026
@sukvvonsukvvon self-assigned this Jul 26, 2026
@sukvvon
sukvvon merged commit e330cee into mainJul 26, 2026
9 checks passed
@sukvvon
sukvvon deleted the test/angular-query-exact-assertions branch July 26, 2026 15:56
Sign up for freeto 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

@sukvvon