Skip to content

fix: resolve all test failures and type errors#22

Open
stooit wants to merge 1 commit into
mainfrom
quantcode/job-e2e-tier2-4060-1779468802
Open

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

Conversation

@stooit
Copy link
Copy Markdown
Contributor

@stooit stooit commented May 22, 2026

Summary

Fixes all failing tests (22 pass, 0 fail) and eliminates all TypeScript type errors across the api and shared packages.

Changes

  • Auth middleware (packages/api/src/middleware/auth.ts): Fixed case-sensitivity bug — HTTP method comparison now uses uppercase ("POST") to match actual request methods, allowing unauthenticated POST requests to public endpoints.
  • Shared types (packages/shared/src/types.ts): Renamed userNameusername on the User type to match field names used across the codebase and tests.
  • Users route (packages/api/src/routes/users.ts): Added missing badRequest import from the errors library.
  • Pagination utility (packages/shared/src/utils/pagination.ts): Implemented the paginate function to slice arrays with offset/limit and return paginated results with metadata.
  • TypeScript config (tsconfig.json): Added bun-types to resolve process.env type error in auth middleware.

Verification

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

…packages

- Fix auth middleware case-sensitivity: compare HTTP methods in uppercase (POST not post)
- Fix User type field name: userName → username to match test expectations
- Add missing badRequest import in users route handler
- Implement pagination utility (paginate function) to satisfy shared package tests
- Add bun-types to tsconfig to resolve process.env type error
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