Skip to content

fix: resolve all failing tests and type errors#19

Open
stooit wants to merge 1 commit into
mainfrom
quantcode/job-e2e-tier2-2494-1779438525
Open

fix: resolve all failing tests and type errors#19
stooit wants to merge 1 commit into
mainfrom
quantcode/job-e2e-tier2-2494-1779438525

Conversation

@stooit
Copy link
Copy Markdown
Contributor

@stooit stooit commented May 22, 2026

Summary

  • Auth middleware: Fixed case-sensitivity bug where publicMethods used lowercase "post" but HTTP methods arrive as uppercase "POST", causing authenticated routes to reject valid public requests
  • Users route: Added missing badRequest import and fixed field name mismatch between request body (username) and User type (name)
  • Pagination utility: Implemented the paginate<T>() function that was previously a stub throwing "not implemented"
  • TypeScript config: Added bun-types to tsconfig.json compilerOptions.types to resolve bun:test module and process global type errors

Verification

All 22 tests pass, 0 type errors:

bun test → 22 pass, 0 fail, 37 expect() calls
npx tsc --noEmit → clean

Files Changed

  • packages/api/src/middleware/auth.ts — uppercase method in publicMethods, removed bare process usage
  • packages/api/src/routes/users.ts — added import, mapped usernamename
  • packages/shared/src/types.ts — ensured User type field consistency
  • packages/shared/src/utils/pagination.ts — implemented paginate function
  • tsconfig.json — added bun-types for type resolution

- Fix auth middleware case-sensitivity bug (POST method matching)
- Add missing badRequest import in users route handler
- Fix field name mismatch between User type and route handler
- Implement pagination utility function
- Add bun-types to tsconfig 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