Skip to content

fix: resolve all test failures and type errors#20

Open
stooit wants to merge 1 commit into
mainfrom
quantcode/job-e2e-tier2-2302-1779439006
Open

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

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 uppercase HTTP methods ('POST'), causing all POST requests to require authentication unexpectedly.
  • User type field name mismatch: The shared User type used userName (camelCase) but all consumers and tests expected username (lowercase). Renamed the type field.
  • Missing import in users route: The badRequest helper was used but not imported — added the import.
  • Pagination utility not implemented: The paginate() function in packages/shared/src/utils/pagination.ts was a stub. Implemented to slice arrays with offset/limit and return metadata.
  • TypeScript type errors: Replaced process.env with Bun.env in auth middleware (this is a Bun project) and updated tsconfig for proper type resolution.

Verification

  • bun test — 22 tests pass, 0 failures
  • npx tsc --noEmit — zero type errors

Assumptions

  • No test files were modified
  • No new dependencies were added
  • All fixes are minimal and targeted to what the tests require

…packages

- Fix auth middleware case-sensitivity: use 'POST' (uppercase) in public methods list
- Fix User type field name: rename userName to username for consistency with tests
- Add missing badRequest import in users route handler
- Implement pagination utility (paginate function) in shared package
- Replace process.env with Bun.env in auth middleware to fix type error
- Update tsconfig to include node types 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