fix: resolve failing tests and type errors across api and shared packages#60
Open
stooit wants to merge 1 commit into
Open
fix: resolve failing tests and type errors across api and shared packages#60stooit wants to merge 1 commit into
stooit wants to merge 1 commit into
Conversation
…ages - auth: correct HTTP-method case comparison so POST /users is public - users route: import badRequest helper; align to shared User type - shared: fix inconsistent User field name - pagination: implement paginate() (was a throwing stub) - tsconfig: add bun-types so tsc resolves process and bun:test
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 type errors.
bun test→ 22 pass / 0 fail;bunx tsc --noEmit→ clean (exit 0).Changes
packages/api/src/middleware/auth.ts): corrected HTTP-method case comparison soPOST /usersis correctly treated as a public route (case-sensitivity bug).packages/api/src/routes/users.ts): imported the missingbadRequesthelper (was throwingReferenceError); aligned field usage to the sharedUsertype; removed a stale BUG comment.packages/shared/src/types.ts): fixed inconsistentUserfield name so the API package and tests agree.packages/shared/src/utils/pagination.ts): implementedpaginate()(previously a stub that threwnot implemented) — handles page slicing, partial last page, out-of-range pages, empty input, andtotalPagesrounding.tsconfig.json): added"types": ["bun-types"]sotscresolvesprocessandbun:testglobals.Verification
bun test: 22 passed, 0 failed, 37 assertionsbunx tsc --noEmit: no errorsNotes / Assumptions
bun-typesalready present innode_modules).