Skip to content

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

Open
stooit wants to merge 1 commit into
mainfrom
quantcode/job-e2e-tier2-2388-1780075280
Open

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

Conversation

@stooit
Copy link
Copy Markdown
Contributor

@stooit stooit commented May 29, 2026

Summary

  • Auth middleware: Fixed case-sensitivity bug where HTTP method comparison failed for uppercase methods like POST, causing public routes to incorrectly return 401. Also replaced process.env with Bun.env.
  • Users route: Added missing badRequest import that caused runtime ReferenceError.
  • Shared types: Renamed userName field to username in the User type to match the API contract expected by tests.
  • Pagination utility: Implemented the paginate() function with proper page slicing, bounds handling, and total page calculation.
  • tsconfig: Added skipLibCheck: true for cleaner type checking.

Verification

All 22 tests pass across 4 test files, and tsc --noEmit reports zero errors.

Assumptions

  • The username field name is the correct API contract (tests send/expect username, not userName).
  • Public routes should match HTTP methods case-insensitively since different frameworks may normalize method casing differently.
  • Bun.env is the correct environment variable access pattern for this Bun-based project.

…packages

- Fix auth middleware case-sensitivity bug (compare HTTP methods case-insensitively)
- Replace process.env with Bun.env in auth middleware
- Add missing badRequest import in users route handler
- Rename userName to username in shared User type to match API contract
- Implement paginate utility function with proper page slicing and bounds handling
- Add skipLibCheck to tsconfig for cleaner type checking
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