Skip to content

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

Open
stooit wants to merge 1 commit into
mainfrom
quantcode/job-e2e-tier2-2390-1779727929
Open

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

Conversation

@stooit
Copy link
Copy Markdown
Contributor

@stooit stooit commented May 25, 2026

Summary

  • Auth middleware: Fixed case-sensitivity bug where HTTP methods were compared as lowercase ("post") but Hono provides them uppercase ("POST"), causing POST requests to incorrectly return 401
  • Shared types: Renamed name field to username in the User type to match what the API route handlers and tests expect
  • Pagination utility: Implemented the paginate() function that was previously a stub throwing "not implemented"
  • Users route: Added missing badRequest import from the responses helper module
  • TypeScript config: Replaced process.env with Bun.env to eliminate the need for @types/node, and added skipLibCheck for Bun compatibility

Verification

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

Assumptions

  • Used Bun.env instead of process.env since this is a Bun-native project
  • Added skipLibCheck: true to tsconfig to avoid type conflicts with Bun's bundled type definitions
  • The paginate function uses 1-based page indexing as expected by the test suite

…packages

- Fix auth middleware case-sensitivity bug (POST method matching)
- Replace process.env with Bun.env to eliminate @types/node dependency
- Add missing badRequest import in users route handler
- Fix User type field name (name → username) in shared types
- Implement paginate utility function in shared package
- Add skipLibCheck to tsconfig for Bun compatibility
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