Skip to content

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

Open
stooit wants to merge 1 commit into
mainfrom
quantcode/e2e-tier2-2411-1780126342
Open

fix: resolve all test failures and type errors across api and shared packages#34
stooit wants to merge 1 commit into
mainfrom
quantcode/e2e-tier2-2411-1780126342

Conversation

@stooit
Copy link
Copy Markdown
Contributor

@stooit stooit commented May 30, 2026

Summary

  • Auth middleware: Fixed case-sensitivity bug where HTTP method comparison failed for uppercase methods (e.g., POST), causing authenticated routes to return 401
  • Auth middleware: Replaced process.env with Bun.env to eliminate TS2580 type error
  • Users route: Added missing badRequest import that caused runtime failures
  • Shared types: Renamed userName field to username in User type to match API contract expected by tests
  • Pagination utility: Implemented the paginate<T>() function (was a stub throwing "not implemented")
  • TypeScript config: Added skipLibCheck for Bun type compatibility

Verification

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

Assumptions

  • The User type field should be username (lowercase, no camelCase) based on test expectations
  • The pagination utility uses 1-indexed pages
  • Bun.env is the appropriate replacement for process.env in this Bun-based project

…packages

- Fix auth middleware case-sensitivity bug (method comparison now matches uppercase HTTP methods)
- Replace process.env with Bun.env in auth middleware to fix TS2580
- Import badRequest helper in users route handler
- Rename User type field from userName to username for consistency with tests
- Implement paginate utility function in shared package
- Add skipLibCheck to tsconfig for bun type 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