Unit tests for lib/skills.ts and lib/clawhub.ts (SOL-7)#11
Open
VisionaireLabs wants to merge 1 commit into
Open
Unit tests for lib/skills.ts and lib/clawhub.ts (SOL-7)#11VisionaireLabs wants to merge 1 commit into
VisionaireLabs wants to merge 1 commit into
Conversation
Zero-dependency test harness using Node's native test runner and TypeScript type-stripping (node --test). A tiny resolve hook (test/resolve-ts.mjs) handles the lib/ sources' extensionless imports. Coverage: - Catalog parsing: combined catalog + ClawHub set load and every record is well-formed (required fields, unique slugs/ids, valid dates). - Count derivation: STATS.totalSkills/originals/listings partition, indexedInstalls = real sum of skills.sh telemetry, CATEGORIES is the deduped sorted union, getSkillBySlug/getFeatured consistency. - Schema integrity: kind/license/status/provenance against the type system; originals are first-party, listings are not; ClawHub source attribution; no fabricated installs (any count must carry a fetchedAt and first-party originals carry none). Also switches three type-only imports to `import type` (required for Node's type-stripping and recommended under isolatedModules), excludes test/ from the app tsconfig and ESLint surface. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Co-authored-by: multica-agent <github@multica.ai>
|
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.
What
Adds unit-test coverage for the skills catalog data layer, plus a zero-dependency test harness.
Test harness
npm testruns Node's native test runner (node --test) overtest/**/*.test.ts.test/resolve-ts.mjs) maps the lib sources' extensionless relative imports to.ts.Coverage (30 tests)
Catalog parsing — combined catalog and the ClawHub set load and each record is well-formed: required string fields present, slugs and ids unique, platforms/categories non-empty, dates parse.
Count derivation —
STATS.totalSkillsequals catalog length; originals + listings partition exactly;indexedInstallsequals the real sum of skills.sh telemetry only;CATEGORIESis the deduped, sorted union;getSkillBySluground-trips;getFeaturedSkillsmatches.Schema integrity —
kind/license/status/provenancevalidated against the type system's label maps; originals arefirst-party, listings are not; ClawHub entries areindexed+externalwithclawhub:source attribution and never claim Solid State authorship.No fabricated installs — any non-zero install/star count must carry a valid
fetchedAttimestamp; first-party originals carry no install count.Incidental
import type(required for Node type-stripping; also recommended underisolatedModules).test/excluded from the apptsconfigand ESLint surface so the build/lint surface is unchanged.All 30 tests pass locally.
🤖 Generated with Claude Code