Tests — cache cycle, URL building, error mapping, ZIP guards #118
Labels
No labels
bug
chore
documentation
enhancement
feature
ready
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
david/pi-extensions-and-skills#118
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
The jest test suite for the Actions tooling: cache cycle (exists/missing/refresh), URL/query building for every filter, error mapping, and ZIP extraction guards — real fs on
os.tmpdir()subdirs, mockedfetchonly.Background
Part of the Forgejo Actions tooling feature (tracking issue #111 — branch
feature/issue-111/forgejo-actions-tools, commitsissue-111: ...). Depends on the registration step (#117). Consolidates and completes the tests sketched in the earlier steps (#113 path math + I/O, #114 URLs/errors, #115 cache cycle, #116 ZIP guards, #117 registration) into the repo's jest setup. TDD convention in this extension: RED → GREEN → REFACTOR per task. Existing tests (tests/issues.test.ts,tests/pulls.test.ts,tests/index.test.ts) mockforgejoApiCall/fetch— follow the same pattern.Implementation Details
tests/actionsCache.test.ts(pure path math; real-fs read/write inos.tmpdir()subdirs with teardown cleanup),tests/actions.test.ts(mockfetch), plustests/index.test.tsadditions for the 5 registered tools.refresh→ re-fetch (assert fetch call counts).ApiError.os.tmpdir()subdirs, cleaned up after.Acceptance Criteria
npm testgreen inextensions/forgejo/with the full suite (existing + new) — no coverage regression.npm run check(tsc --noEmit) passes.os.tmpdir().Test Plan
cd extensions/forgejo && npm test -- --coverageand eyeball the new files' coverage.npm run check.Verified complete — closing.
npm testinextensions/forgejo/: 259 tests passed (11 suites), including the newtests/actions.test.tsandtests/actionsCache.test.ts.npm run check(tsc --noEmit): clean.forgejo_action_*tools intests/index.test.ts.Note: this work landed as part of the tracking-issue commits (
ee2b5ac"111: Tracking…" plus the #115/#116 commits) rather than a dedicatedissue-118:PR, which is why the issue was left open.