test: add list command and API tests to prevent broken CLI regressions#3
Merged
Conversation
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.
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.
Summary
src/api.spec.ts— unit tests forKeeplyApi, including a regression test thatlistBookmarksreturns an array extracted from the paginated response (the exact bug that causedkeeply listto break)src/commands/list.spec.ts— end-to-end command tests covering default view,--urls,--json,--archived,--folder, and--tagfiltersdist/which was stale (last built Apr 5, fix landed Apr 12)Background
keeply listwas broken with✖ bookmarks.filter is not a function. Root cause:dist/api.jswas never rebuilt after commit886758cwhich fixedlistBookmarksto unwrap.datafrom the paginated response. The stale dist returned the full{ data, total, page, limit }object, so.filter()failed.Test plan
npm test— 50 tests, all passingnpx tsc --noEmit— cleankeeply listtested locally and working