Skip to content

fix: resolve all failing tests and type errors#5

Open
stooit wants to merge 1 commit into
mainfrom
quantcode/job-e2e-tier2-2297-1779433342
Open

fix: resolve all failing tests and type errors#5
stooit wants to merge 1 commit into
mainfrom
quantcode/job-e2e-tier2-2297-1779433342

Conversation

@stooit
Copy link
Copy Markdown
Contributor

@stooit stooit commented May 22, 2026

Summary

Fixes all 22 failing tests and eliminates all TypeScript type errors across both packages.

Changes

  • Pagination utility (packages/shared/src/utils/pagination.ts): Implemented the paginate() function that was previously a stub throwing "not implemented". Correctly slices items by page/size and returns PaginatedResponse<T> with total, totalPages, and page metadata.

  • User type field name (packages/shared/src/types.ts): Renamed userNameusername to match the field name used in route handlers and tests.

  • Auth middleware case-sensitivity (packages/api/src/middleware/auth.ts): Fixed HTTP method comparison to be case-insensitive, so public routes like POST /users are correctly excluded from auth checks.

  • Missing import (packages/api/src/routes/users.ts): Added missing badRequest import from the response helpers module.

  • TypeScript config (tsconfig.json): Added bun-types to compiler options for proper Bun global type resolution.

Verification

bun test → 22 pass, 0 fail, 37 expect() calls
npx tsc --noEmit → no errors

Assumptions

  • No test files were modified
  • No new dependencies were added
  • The bun-types package was already available in node_modules

- Implement paginate() utility in shared package
- Fix User type field name: userName -> username
- Fix auth middleware case-sensitivity bug for HTTP methods
- Add missing badRequest import in users route handler
- 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