Skip to content

fix: resolve all test failures and type errors#31

Open
stooit wants to merge 1 commit into
mainfrom
quantcode/job-e2e-tier2-2460-1780030907
Open

fix: resolve all test failures and type errors#31
stooit wants to merge 1 commit into
mainfrom
quantcode/job-e2e-tier2-2460-1780030907

Conversation

@stooit
Copy link
Copy Markdown
Contributor

@stooit stooit commented May 29, 2026

Summary

  • Auth middleware: Fixed case-sensitivity bug where HTTP method comparison was case-sensitive, causing POST requests to public routes to incorrectly return 401
  • Users route: Added missing badRequest import from error helpers and fixed field name to match the User type
  • Shared types: Renamed userName field to username on the User type for consistency with the API contract
  • Pagination utility: Implemented the paginate<T> function that was previously a stub throwing "not implemented"
  • TypeScript config: Added bun-types to compilerOptions.types so bun:test and Bun globals resolve correctly

Verification

All 22 tests pass and tsc --noEmit produces zero errors.

Assumptions

  • The User type field was renamed from userName to username since all tests and route handlers use username — this is the intended API contract
  • The pagination utility returns { data, page, size, total, totalPages } matching the PaginatedResponse<T> type

…packages

- Fix auth middleware case-sensitivity bug (method comparison now case-insensitive)
- Add missing badRequest import in users route handler
- Rename User type field from userName to username for consistency
- Implement paginate utility function in shared package
- Add bun-types to tsconfig.json compilerOptions 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