fix: repair failing tests and type errors across api and shared packages#43
Open
stooit wants to merge 1 commit into
Open
fix: repair failing tests and type errors across api and shared packages#43stooit wants to merge 1 commit into
stooit wants to merge 1 commit into
Conversation
- shared: rename User.userName to canonical username field - shared: implement paginate utility (1-indexed slice pagination) - api: add missing badRequest import in users route - api: fix auth middleware method-case bug (post -> POST) - tsconfig: add bun-types to resolve bun:test/process type errors
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
Fixes all failing tests and TypeScript errors in the multi-package API repo. Final state: 22 tests pass, 0 fail;
tsc --noEmitclean.Changes
User.userName→username(canonical name the tests assert against).paginatestub — 1-indexed pagination,start=(page-1)*size, returnsdata,page,pageSize,total,totalPages(Math.ceil(total/size),0on empty input; out-of-range pages return empty data).badRequestto the../lib/errorsimport (was causing a runtime ReferenceError on the 400 path)."post"but Hono delivers uppercase method names, soPOST /userswas wrongly treated as protected."types": ["bun-types"]to resolvebun:testandprocesstype errors.bun-typeswas already present innode_modules— no new dependencies added.BUG:/TODO:comments that misdescribed the now-corrected code.Verification
bun test→ 22 pass / 0 failbunx tsc --noEmit→ no errorsAssumptions
username(lowercase), since test files are the source of truth and may not be modified.bun-typesinnode_modulesis acceptable to reference via tsconfig (no install performed, honouring the no-new-dependencies constraint).Constraints honoured
No test files modified. No dependencies added. Only the changes required by the failing tests.