Integrate fast-check property testing into tests for deepEquals#1018
Merged
Integrate fast-check property testing into tests for deepEquals#1018
Conversation
- Add @fast-check/vitest and fast-check dependencies - Add property-based tests for deepEquals (reflexivity, symmetry, transitivity) - Add property-based tests for comparators (antisymmetry, transitivity, consistency) - Add tests for normalizeValue and areValuesEqual utilities - Document known edge case: deepEquals asymmetry between Date and Temporal.Duration
Previously, comparing values like `deepEquals(Date, Temporal.Duration)` and `deepEquals(Temporal.Duration, Date)` could return different results because special type checks (Date, RegExp, Map, Set, TypedArray, Temporal) only checked if `a` was the special type, not if `b` was. This fix adds symmetric checks after each special type handler: - If `b` is Date but `a` is not, return false - If `b` is RegExp but `a` is not, return false - If `b` is Map but `a` is not, return false - If `b` is Set but `a` is not, return false - If `b` is TypedArray but `a` is not, return false - If `b` is Temporal but `a` is not, return false - If `b` is Array but `a` is not, return false This ensures deepEquals is a proper equivalence relation where `deepEquals(a, b) === deepEquals(b, a)` always holds.
🦋 Changeset detectedLatest commit: fee1389 The changes in this PR will be included in the next version bump. This PR includes changesets to release 12 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
More templates
@tanstack/angular-db
@tanstack/db
@tanstack/db-ivm
@tanstack/electric-db-collection
@tanstack/offline-transactions
@tanstack/powersync-db-collection
@tanstack/query-db-collection
@tanstack/react-db
@tanstack/rxdb-db-collection
@tanstack/solid-db
@tanstack/svelte-db
@tanstack/trailbase-db-collection
@tanstack/vue-db
commit: |
Contributor
|
Size Change: +43 B (+0.05%) Total Size: 89.5 kB
ℹ️ View Unchanged
|
Contributor
|
Size Change: 0 B Total Size: 3.35 kB ℹ️ View Unchanged
|
Add fast-check property-based tests for additional modules: - hash.property.test.ts: Tests determinism, structural equality, property order independence, number normalization, and type distinction - cursor.property.test.ts: Tests empty input handling, single/multi-column cursor generation, operator consistency, and value preservation - pg-serializer.property.test.ts: Tests serialization round-trips for strings, numbers, bigints, booleans, dates, and arrays
Fix TypeScript type errors in cursor.property.test.ts by adding explicit type casts for nulls and stringSort parameters at usage sites.
🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
The __proto__ property has special behavior in JavaScript that causes issues when used as an object key in property-based tests. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
parseFloat("-0") returns 0 (not -0), so -0 cannot round-trip through
string serialization. This is a known JavaScript edge case.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
kevin-dp
approved these changes
Jan 7, 2026
Contributor
|
🎉 This PR has been released! Thank you for your contribution! |
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
✅ Checklist
pnpm test:pr.🚀 Release Impact