Skip to content

fix: resolve all test failures and type errors#39

Open
stooit wants to merge 1 commit into
mainfrom
quantcode/e2e-tier2-2447-1780452486
Open

fix: resolve all test failures and type errors#39
stooit wants to merge 1 commit into
mainfrom
quantcode/e2e-tier2-2447-1780452486

Conversation

@stooit
Copy link
Copy Markdown
Contributor

@stooit stooit commented Jun 3, 2026

Summary

  • Pagination utility: Implemented paginate<T>() in packages/shared/src/utils/pagination.ts — computes total, totalPages, slices items correctly, handles out-of-range pages and empty arrays.
  • Shared types: Renamed userNameusername in the User type (packages/shared/src/types.ts) to match what the API routes and tests expect.
  • Missing import: Added badRequest import to packages/api/src/routes/users.ts from the existing response helpers module.
  • Auth middleware case-sensitivity: Fixed method comparison in packages/api/src/middleware/auth.ts — public routes listed post but Hono provides POST; normalized to uppercase comparison.
  • TypeScript config: Added bun-types to tsconfig for proper process and bun runtime type resolution.

All 22 tests pass. Zero type errors from tsc --noEmit.

…packages

- Implement paginate<T>() utility in shared/utils/pagination.ts
- Rename userName → username in shared User type for consistency
- Add missing badRequest import in api/routes/users.ts
- Fix auth middleware case-sensitivity (post → POST) for public routes
- Add bun-types to tsconfig for proper type resolution
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