fix: resolve all failing tests and type errors#47
Open
stooit wants to merge 1 commit into
Open
Conversation
…ages - Implement pagination utility (was a throwing stub) - Align shared User type field userName -> username to match tests - Add missing badRequest import in users route - Fix HTTP-method case-sensitivity bug in auth middleware for public routes - Fix tsconfig types so bun:test and process resolve under tsc (no new deps)
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 type errors across the
apiandsharedpackages. Final state: 22 pass / 0 fail (bun test) and 0 type errors (tsc --noEmit).Changes
packages/shared/src/utils/pagination.ts): implemented the previously-throwing stub — page slicing,total,totalPages, andpage/pageSizefields with empty/out-of-range handling.Usertype (packages/shared/src/types.ts+packages/api/src/routes/users.ts): renamed the fielduserName→usernameso the source matches what the tests expect (field-name inconsistency between packages).packages/api/src/routes/users.ts): added the missingbadRequestimport that caused a failure.packages/api/src/middleware/auth.ts): fixed an HTTP-method case-sensitivity bug so public routes (e.g.POST /users) are correctly matched.tsconfig.json): adjustedtypessotscresolvesbun:testandprocess— no new dependencies added.Verification
bun test→ 22 pass, 0 failnpx tsc --noEmit→ exit 0Notes / assumptions
username(lowercase) because the test files reference that spelling; source was changed to match the tests.