Skip to content

test: add list command and API tests to prevent broken CLI regressions#3

Merged
RolfKoenders merged 1 commit into
mainfrom
fix/list-command-tests
Apr 23, 2026
Merged

test: add list command and API tests to prevent broken CLI regressions#3
RolfKoenders merged 1 commit into
mainfrom
fix/list-command-tests

Conversation

@RolfKoenders

Copy link
Copy Markdown
Member

Summary

  • Adds src/api.spec.ts — unit tests for KeeplyApi, including a regression test that listBookmarks returns an array extracted from the paginated response (the exact bug that caused keeply list to break)
  • Adds src/commands/list.spec.ts — end-to-end command tests covering default view, --urls, --json, --archived, --folder, and --tag filters
  • Rebuilds dist/ which was stale (last built Apr 5, fix landed Apr 12)

Background

keeply list was broken with ✖ bookmarks.filter is not a function. Root cause: dist/api.js was never rebuilt after commit 886758c which fixed listBookmarks to unwrap .data from the paginated response. The stale dist returned the full { data, total, page, limit } object, so .filter() failed.

Test plan

  • npm test — 50 tests, all passing
  • npx tsc --noEmit — clean
  • keeply list tested locally and working

Adds tests for `listBookmarks` (ensures it unwraps `.data` from the
paginated response) and the `list` command (default view, --urls, --json,
--archived, --folder, --tag filters). The missing test coverage allowed a
stale dist to ship a broken `keeply list` silently.
@RolfKoenders RolfKoenders merged commit c32f81c into main Apr 23, 2026
2 checks passed
@RolfKoenders RolfKoenders deleted the fix/list-command-tests branch April 23, 2026 17:39
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