Skip to content

fix: resolve all test failures across api and shared packages#14

Open
stooit wants to merge 1 commit into
mainfrom
quantcode/job-e2e-tier2-2514-1779437773
Open

fix: resolve all test failures across api and shared packages#14
stooit wants to merge 1 commit into
mainfrom
quantcode/job-e2e-tier2-2514-1779437773

Conversation

@stooit
Copy link
Copy Markdown
Contributor

@stooit stooit commented May 22, 2026

Summary

  • Auth middleware: Fixed HTTP method case-sensitivity bug — the public routes allow-list compared against lowercase "post" but Hono provides uppercase "POST", causing POST /users to incorrectly return 401.
  • Users route: Added missing badRequest helper function and fixed field reference from userName to username.
  • Shared types: Renamed userName field to username in the User type for consistency with how all consumers reference it.
  • Pagination utility: Implemented the paginate<T>() function (was previously a stub throwing "not implemented") with correct 1-based page slicing, edge-case handling for empty arrays and out-of-range pages.

Verification

All 22 tests pass (bun test). TypeScript type-check (npx tsc --noEmit) shows only pre-existing environment errors (bun:test module and process — these require @types/bun and @types/node which are outside scope).

Assumptions

  • The process.env.API_KEY reference in auth middleware is expected to work at runtime via Bun's Node.js compatibility — the TS error is a dev-tooling gap, not a bug.
  • No test files were modified.
  • No new dependencies were added.

- Auth middleware: fix HTTP method case-sensitivity (post → POST)
- Users route: add missing badRequest helper and fix field reference
- Shared types: rename userName to username for consistency with tests
- Pagination utility: implement paginate function with correct slicing
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