Skip to content

fix: resolve all test failures and type errors across api and shared packages#32

Open
stooit wants to merge 1 commit into
mainfrom
quantcode/job-e2e-tier2-2525-1780042364
Open

fix: resolve all test failures and type errors across api and shared packages#32
stooit wants to merge 1 commit into
mainfrom
quantcode/job-e2e-tier2-2525-1780042364

Conversation

@stooit
Copy link
Copy Markdown
Contributor

@stooit stooit commented May 29, 2026

Summary

  • Auth middleware: Fixed case-sensitivity bug — HTTP method allow-list used lowercase ("post") while Hono reports uppercase ("POST"), causing authenticated routes to reject valid public requests.
  • Users route: Added missing badRequest import from ../lib/errors that caused runtime failures on validation.
  • Shared User type: Renamed field from name to username to match the API contract expected by tests and route handlers.
  • Pagination utility: Implemented paginate<T>() function with 1-indexed pages, proper slicing, and edge-case handling (empty input, out-of-range pages).
  • TypeScript config: Added @types/node to tsconfig types array to resolve process.env type errors in auth middleware.

Verification

All 22 tests pass across 4 test files. Zero TypeScript errors (tsc --noEmit clean).

Assumptions

  • Tests are the source of truth — no test files were modified.
  • No new dependencies added; only existing type definitions referenced.

…packages

- Fix auth middleware case-sensitivity: use uppercase HTTP methods in allow-list
- Add missing badRequest import in users route handler
- Rename User type field from 'name' to 'username' to match API contract
- Implement paginate utility with proper page slicing and edge cases
- Add node types to tsconfig for process.env 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