Skip to content

fix: resolve all test failures and type errors#3

Open
stooit wants to merge 1 commit into
mainfrom
quantcode/job-e2e-tier2-2354-1779432558
Open

fix: resolve all test failures and type errors#3
stooit wants to merge 1 commit into
mainfrom
quantcode/job-e2e-tier2-2354-1779432558

Conversation

@stooit
Copy link
Copy Markdown
Contributor

@stooit stooit commented May 22, 2026

Summary

  • Auth middleware: Fixed case-sensitivity bug — HTTP method comparison now uses .toUpperCase() so POST requests are correctly recognized regardless of casing
  • Shared types: Renamed userNameusername on the User type to match what route handlers and tests expect
  • Pagination utility: Implemented paginate() function that was previously a stub throwing "not implemented"
  • Users route: Fixed missing import (badRequestcreateError) and aligned field names with the corrected User type
  • TypeScript config: Added bun-types to tsconfig.json compilerOptions.types to resolve process and other Node/Bun global type errors

Verification

  • bun test → 22 tests pass, 0 failures
  • npx tsc --noEmit → 0 type errors

Assumptions

  • The PaginatedResponse<T> type already existed in packages/shared/src/types.ts with fields: data, page, pageSize, total, totalPages
  • bun-types was already available in node_modules (no new dependency added)
  • Test files were not modified

…packages

- Fix auth middleware case-sensitivity bug (compare HTTP methods case-insensitively)
- Rename User type field userName → username for consistency with route handlers
- Implement paginate() utility function in shared package
- Fix missing import in users route (use createError instead of non-existent badRequest)
- Add bun-types to tsconfig to resolve type errors in source files
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