Skip to content

test: improve coverage with new tests for badges, skillZip, uploadFiles#133

Merged
shakkernerd merged 7 commits into
mainfrom
test/improve-coverage
Feb 5, 2026
Merged

test: improve coverage with new tests for badges, skillZip, uploadFiles#133
shakkernerd merged 7 commits into
mainfrom
test/improve-coverage

Conversation

@shakkernerd

@shakkernerd shakkernerd commented Feb 5, 2026

Copy link
Copy Markdown
Member

Summary

  • Add comprehensive tests for badges.ts utility functions
  • Add tests for skillZip.ts deterministic ZIP building from PR VirusTotal Integration on ClawHub #130
  • Add jsdom tests for expandDroppedItems function in uploadFiles.ts
  • Add test for 4+ errors truncation in ark schema validation
  • Track convex/lib/skillZip.ts in coverage reports

Test plan

  • bun run coverage passes with 70.76% branch coverage (above 70% threshold)
  • bun run lint passes
  • All 336 tests pass

Greptile Overview

Greptile Summary

This PR increases test coverage by adding new unit tests for src/lib/badges.ts, deterministic ZIP generation in convex/lib/skillZip.ts, and jsdom coverage for expandDroppedItems in src/lib/uploadFiles.ts. It also adds a schema test intended to ensure ark validation errors are truncated (4+ errors) and updates vitest.config.ts to include convex/lib/skillZip.ts in coverage reporting.

Confidence Score: 4/5

  • This PR is safe to merge once the new schema truncation test assertion is made more specific.
  • Changes are isolated to tests and coverage config; the only concrete issue found is an overly broad toThrow('+') assertion that can yield false positives and weaken regression coverage.
  • packages/schema/src/schemas.test.ts

Context used:

  • Context from dashboard - AGENTS.md (source)

Add comprehensive tests for the badges utility functions:
- isSkillHighlighted, isSkillOfficial, isSkillDeprecated
- getSkillBadges with all badge combinations

Improves branch coverage from 50% to 100% for badges.ts.
Add tests for the deterministic ZIP building utility from PR #130:
- buildSkillMeta function
- buildDeterministicZip with various scenarios
- Verifies deterministic output and _meta.json inclusion

Achieves 100% coverage for skillZip.ts.
Add jsdom tests for the expandDroppedItems function:
- Handles null/empty DataTransferItemList
- Collects files via getAsFile fallback
- Collects files via webkitGetAsEntry for file entries
- Recursively collects files from directory entries
- Skips non-file/non-directory entries

Improves branch coverage for uploadFiles.ts.
Test the formatArkErrors truncation logic when there are more than
3 validation errors, ensuring the "+N more" message is displayed.
Include convex/lib/skillZip.ts in coverage reports to track
the deterministic ZIP building utility added in PR #130.
Add entries for new tests and coverage configuration changes.
Format import statement to single line per Biome rules.
@vercel

vercel Bot commented Feb 5, 2026

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
clawhub Ready Ready Preview, Comment Feb 5, 2026 3:00am

@greptile-apps greptile-apps Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 file reviewed, 1 comment

Edit Code Review Agent Settings | Greptile

Comment thread packages/schema/src/schemas.test.ts
@shakkernerd
shakkernerd merged commit 98dd49c into main Feb 5, 2026
5 checks passed
@shakkernerd
shakkernerd deleted the test/improve-coverage branch February 5, 2026 03:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant