[PR #133] [MERGED] test: improve coverage with new tests for badges, skillZip, uploadFiles #267

Closed
opened 2026-02-15 17:16:35 -05:00 by yindo · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/openclaw/clawhub/pull/133
Author: @shakkernerd
Created: 2/4/2026
Status: Merged
Merged: 2/4/2026
Merged by: @shakkernerd

Base: mainHead: test/improve-coverage


📝 Commits (7)

  • 99ecf9c test: add badges module tests
  • ac2f45d test: add skillZip module tests
  • 4fc360e test: add expandDroppedItems tests for uploadFiles
  • 737781a test: add 4+ errors truncation test for ark schema
  • 9f4edb0 chore: add skillZip.ts to coverage tracking
  • 9dd7588 docs: update changelog for coverage improvements
  • a4f7562 style: fix badges test import formatting

📊 Changes

6 files changed (+387 additions, -1 deletions)

View changed files

📝 CHANGELOG.md (+2 -0)
convex/lib/skillZip.test.ts (+139 -0)
📝 packages/schema/src/schemas.test.ts (+11 -0)
src/lib/badges.test.ts (+98 -0)
📝 src/lib/uploadFiles.jsdom.test.ts (+136 -1)
📝 vitest.config.ts (+1 -0)

📄 Description

Summary

  • Add comprehensive tests for badges.ts utility functions
  • Add tests for skillZip.ts deterministic ZIP building from PR #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)

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/openclaw/clawhub/pull/133 **Author:** [@shakkernerd](https://github.com/shakkernerd) **Created:** 2/4/2026 **Status:** ✅ Merged **Merged:** 2/4/2026 **Merged by:** [@shakkernerd](https://github.com/shakkernerd) **Base:** `main` ← **Head:** `test/improve-coverage` --- ### 📝 Commits (7) - [`99ecf9c`](https://github.com/openclaw/clawhub/commit/99ecf9c00bc569a25056b9bbc498dfcaba0d4a5e) test: add badges module tests - [`ac2f45d`](https://github.com/openclaw/clawhub/commit/ac2f45d6cd4e6c624772a388fee588a1845d44c6) test: add skillZip module tests - [`4fc360e`](https://github.com/openclaw/clawhub/commit/4fc360ebaf1e5646808a836d37448e18a3c6be3d) test: add expandDroppedItems tests for uploadFiles - [`737781a`](https://github.com/openclaw/clawhub/commit/737781abc75f191ca272030fa72bb633db749dfc) test: add 4+ errors truncation test for ark schema - [`9f4edb0`](https://github.com/openclaw/clawhub/commit/9f4edb01f2c348b952ddf92e87c4d085012e05ae) chore: add skillZip.ts to coverage tracking - [`9dd7588`](https://github.com/openclaw/clawhub/commit/9dd758849fba08e34401390f998498b4424ea529) docs: update changelog for coverage improvements - [`a4f7562`](https://github.com/openclaw/clawhub/commit/a4f756266b72839253a0bfd2a8d9ef88f6532370) style: fix badges test import formatting ### 📊 Changes **6 files changed** (+387 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `CHANGELOG.md` (+2 -0) ➕ `convex/lib/skillZip.test.ts` (+139 -0) 📝 `packages/schema/src/schemas.test.ts` (+11 -0) ➕ `src/lib/badges.test.ts` (+98 -0) 📝 `src/lib/uploadFiles.jsdom.test.ts` (+136 -1) 📝 `vitest.config.ts` (+1 -0) </details> ### 📄 Description ## Summary - Add comprehensive tests for `badges.ts` utility functions - Add tests for `skillZip.ts` deterministic ZIP building from PR #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 - [x] `bun run coverage` passes with 70.76% branch coverage (above 70% threshold) - [x] `bun run lint` passes - [x] All 336 tests pass <!-- greptile_comment --> <h2>Greptile Overview</h2> <h3>Greptile Summary</h3> 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. <h3>Confidence Score: 4/5</h3> - 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 <!-- greptile_other_comments_section --> **Context used:** - Context from `dashboard` - AGENTS.md ([source](https://app.greptile.com/review/custom-context?memory=a1d58d20-b4dd-4cbb-973a-9fd7824e1921)) <!-- /greptile_comment --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
yindo added the pull-request label 2026-02-15 17:16:35 -05:00
yindo closed this issue 2026-02-15 17:16:35 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: openclaw/clawhub#267