Cover lib/availability; bump global ratchet#144
Merged
Conversation
Brings src/lib/availability.ts from 26.47% to 100% statements (10% to 100% functions, 0% to 100% branches). The file lost most of its incidental coverage when #142 mocked it out of the rule-engine tests; this repays that debt with direct tests against each export. Tests cover the four `resolveAvailability` shapes (undefined / true / false-no-reason / false-with-reason / reactive object), the `getRuleAvailabilityStates` snapshot map across mixed rule types, the `subscribeRuleAvailability` lifecycle (only reactive rules get subscribed, listener fires with a fresh snapshot when a source emits, returned cleanup tears down each source), `availabilitySource` shape (frozen, wired to the right functions), and all four `createApiKeyAvailability` branches (built-in key short-circuits, user key present, user key absent, subscribe wiring). Ratchet global thresholds 65/60/61/65 → 68/63/67/68. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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
Brings `src/lib/availability.ts` from 26.47% → 100% statements (10% → 100% functions, 0% → 100% branches). The file lost most of its incidental coverage when #142 mocked it out of the rule-engine tests; this PR repays that debt with direct tests against each export.
What the tests cover
Ratchet
Global thresholds 65/60/61/65 → 68/63/67/68 to lock in the gain (`src/lib` overall: 90.38% → 95% statements).
Test plan
🤖 Generated with Claude Code