test: dedupe isDefined helper against the library util - #144
Merged
Conversation
mbret
force-pushed
the
chore/consolidation-2026-07-20
branch
from
July 24, 2026 08:53
675649b to
50bec0f
Compare
The live-query test helper (src/tests/liveQuery.tsx) defined its own `isDefined` type-guard, a runtime-identical copy of the shipped `src/lib/utils/isDefined.ts`. Import the library util directly in the two live-query test suites and delete the local copy, so there is one implementation instead of two. Behavior-preserving: the query pipes and assertions are unchanged; only the source of `isDefined` moved. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PMgtP4GREPoEq9LdTBcHky
mbret
force-pushed
the
chore/consolidation-2026-07-20
branch
from
July 24, 2026 08:54
50bec0f to
48eb210
Compare
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.
Summary
src/tests/liveQuery.tsxdefined its ownisDefinedtype-guard:This is a runtime-identical copy of the shipped
src/lib/utils/isDefined.ts. The two live-query test suites now importisDefinedfrom the library util directly, and the local copy is deleted — one implementation instead of two.Behavior-preserving: the query pipes and assertions are unchanged; only the source of
isDefinedmoved.Net LOC
2 insertions, 6 deletions→ net −4 lines across 3 files.Note
An earlier revision of this PR also extracted the repeated live-query
queryFnpipe into acreateLiveQueryFnfactory in the shared test helper. That was reverted — a test-only closure factory living in the source tree wasn't a good trade, so the inline pipes are left as-is.Gates
All green locally: biome
check,tsc,vite build,vitest run(129 tests).🤖 Generated with Claude Code