Skip to content

fix: resolve all failing tests in API and shared packages#16

Open
stooit wants to merge 1 commit into
mainfrom
quantcode/job-e2e-tier2-2389-1779438249
Open

fix: resolve all failing tests in API and shared packages#16
stooit wants to merge 1 commit into
mainfrom
quantcode/job-e2e-tier2-2389-1779438249

Conversation

@stooit
Copy link
Copy Markdown
Contributor

@stooit stooit commented May 22, 2026

Summary

  • Auth middleware (packages/api/src/middleware/auth.ts): Fixed case-sensitivity bug where publicMethods used lowercase "post" but HTTP methods arrive uppercase ("POST"). Changed to uppercase to match correctly.
  • Users route (packages/api/src/routes/users.ts): Added missing badRequest helper that was referenced but never defined/imported, causing runtime failures.
  • Shared types (packages/shared/src/types.ts): Renamed userName field to username to match what the API route handlers and tests expect.
  • Pagination utility (packages/shared/src/utils/pagination.ts): Implemented the paginate function which was previously a stub throwing "not implemented".

Verification

All 22 tests pass (bun test). TypeScript type-check (npx tsc --noEmit) shows only environment-specific errors (bun:test module resolution and process global — expected without @types/bun).

Assumptions

  • No test files were modified
  • No new dependencies were added
  • The remaining TS errors about bun:test and process are pre-existing environment configuration issues, not source code bugs

- Auth middleware: fix case-sensitivity bug in HTTP method comparison
- Users route: add missing badRequest import/helper
- Shared types: rename userName to username for consistency with tests
- Pagination utility: implement paginate function (was stub)
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