Skip to content

fix: resolve failing tests across api and shared packages#18

Open
stooit wants to merge 1 commit into
mainfrom
quantcode/job-e2e-tier2-2406-1779438609
Open

fix: resolve failing tests across api and shared packages#18
stooit wants to merge 1 commit into
mainfrom
quantcode/job-e2e-tier2-2406-1779438609

Conversation

@stooit
Copy link
Copy Markdown
Contributor

@stooit stooit commented May 22, 2026

Summary

  • Auth middleware case-sensitivity: The publicMethods array in packages/api/src/middleware/auth.ts used lowercase method names ("post") while Hono provides uppercase ("POST"), causing POST requests to incorrectly receive 401 responses.
  • User type field naming: packages/shared/src/types.ts defined userName but tests and route handlers expected username. Renamed to username for consistency.
  • Missing import in users route: packages/api/src/routes/users.ts referenced an undefined badRequest helper. Added the import from the shared utilities.
  • Pagination utility stub: packages/shared/src/utils/pagination.ts was not implemented. Added the paginate function matching the test expectations.

Verification

  • All 22 tests pass (bun test)
  • No type errors (npx tsc --noEmit, excluding environment-only bun:test module resolution)

Assumptions

  • No test files were modified
  • No new dependencies were added
  • Only source files were changed to match existing test expectations

- Fix auth middleware case-sensitivity: use uppercase HTTP methods in publicMethods
- Rename User type field userName to username for consistency with tests
- Add missing badRequest import in users route handler
- Implement pagination utility (paginate function) as expected by tests
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