test(lit-query): replace 'toBeDefined'/'toBeGreaterThan' with exact-value assertions - #11122
Merged
Conversation
|
View your CI Pipeline Execution ↗ for commit 99a78c6
☁️ Nx Cloud last updated this comment at |
Contributor
🚀 Changeset Version PreviewNo changeset entries found. Merging this PR will not cause a version bump for any packages. |
Contributor
📝 WalkthroughWalkthroughChangesLit Query test assertions
Estimated code review effort: 1 (Trivial) | ~3 minutes Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
Contributor
size-limit report 📦
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🎯 Changes
Continues the recent test-quality series (e.g. #11105, #11093) by converting the
toBeDefined()/toBeFalsy()assertions inlit-querytests to exact assertions:counters-and-state.test.ts— cache presence check now asserts the exact cached value (?.state.data) produced by the test'squeryFn.infinite-and-options.test.ts— cache presence check now asserts the exact cachedpages/pageParamsshape.queries-controller.test.ts— cache presence check now asserts the exact cached value for the first query key.query-controller.test.ts— three cases strengthened: an existence check now asserts?.state.dataagainst the resolved array, and twodata/call-count checks now assert exact literals instead oftoBeDefined()/toBeGreaterThan(0).Each strengthening is guarded by a preceding
waitFor(... isSuccess)(or equivalent) that guarantees the fetch has settled at the assertion point.✅ Checklist
Local verification detail:
vitest runon the four edited files — 102 tests passed, no type errors.🚀 Release Impact
Summary by CodeRabbit