Skip to content

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

Open
stooit wants to merge 1 commit into
mainfrom
quantcode/job-e2e-tier2-2396-1779437330
Open

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

Conversation

@stooit
Copy link
Copy Markdown
Contributor

@stooit stooit commented May 22, 2026

Summary

  • Auth middleware case-sensitivity: The public methods list used lowercase "post" but Hono provides the method as uppercase "POST", causing POST requests to incorrectly require authentication.
  • User type field name: Renamed userName to username in the shared User type to match what routes and tests expect.
  • Missing import in users route: Added import for badRequest helper so the route handler compiles and returns proper 400 responses.
  • Pagination utility: Implemented the paginate() function in packages/shared/src/utils/pagination.ts to satisfy existing test expectations.
  • process.env reference: Replaced bare process.env in auth middleware source with a globalThis cast to avoid requiring @types/node.

Verification

All 22 tests pass (bun test) and tsc --noEmit reports zero source-file errors.

Assumptions

  • The process reference in test files is acceptable (Bun runtime provides it; type errors in test files are cosmetic since @types/bun is not installed).
  • No new dependencies were added as per constraints.

…packages

- Fix auth middleware case-sensitivity: change 'post' to 'POST' in public methods list
- Rename User type field from 'userName' to 'username' for consistency
- Import badRequest helper in users route handler
- Implement pagination utility (paginate function) per test expectations
- Fix process.env reference in auth.ts to avoid @types/node dependency
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