Skip to content

fix: resolve all failing tests across api and shared packages#10

Open
stooit wants to merge 1 commit into
mainfrom
quantcode/job-e2e-tier2-2376-1779436290
Open

fix: resolve all failing tests across api and shared packages#10
stooit wants to merge 1 commit into
mainfrom
quantcode/job-e2e-tier2-2376-1779436290

Conversation

@stooit
Copy link
Copy Markdown
Contributor

@stooit stooit commented May 22, 2026

Summary

  • Auth middleware case-sensitivity: The publicMethods array used lowercase "post" but HTTP methods from Hono arrive as uppercase "POST". Fixed to match correctly.
  • Missing import in users route: badRequest was used but not imported from ../lib/errors. Added the import.
  • User type field name mismatch: The User type in packages/shared/src/types.ts used userName but all tests and route handlers expect username. Renamed the field.
  • Pagination utility stub: paginate() in packages/shared/src/utils/pagination.ts was throwing "not implemented". Implemented it to return { data, page, pageSize, total, totalPages }.
  • TypeScript process error: Added a declare var process type declaration in auth.ts to resolve the TS2580 error without adding @types/node.

Verification

  • All 22 tests pass (bun test)
  • Zero TypeScript errors in source files (npx tsc --noEmit — remaining errors are only in test files due to missing bun:test type declarations)

Assumptions

  • Test files are the source of truth and were not modified
  • No new dependencies were added
  • The process declaration is minimal and scoped to the single file that uses it

- Fix auth middleware case-sensitivity: match HTTP methods in uppercase (POST not post)
- Add missing badRequest import in users route handler
- Rename User type field from userName to username for consistency with tests
- Implement paginate() utility function in shared package
- Add process type declaration in auth.ts to fix TypeScript error
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