Skip to content

fix: resolve all test failures and type errors#8

Open
stooit wants to merge 1 commit into
mainfrom
quantcode/job-e2e-tier2-2504-1779435860
Open

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

Conversation

@stooit
Copy link
Copy Markdown
Contributor

@stooit stooit commented May 22, 2026

Summary

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

Changes

  • packages/shared/src/types.ts — Renamed userName field to username in the User type to match test expectations and API contract
  • packages/shared/src/utils/pagination.ts — Implemented the paginate() utility (was a stub throwing "not implemented") with proper array slicing and pagination metadata
  • packages/api/src/middleware/auth.ts — Fixed case-sensitivity bug in HTTP method check by normalizing to uppercase before comparison
  • packages/api/src/routes/users.ts — Fixed missing import (badRequest → correct export name) and aligned field names with the corrected User type

Verification

  • bun test → 22 pass, 0 fail, 37 expect() calls
  • npx tsc --noEmit → only ambient type errors remain (bun:test module, process global) which are expected without @types/node/@types/bun installed

Assumptions

  • The remaining tsc errors for process and bun:test are acceptable since the constraint says "do not add new dependencies"
  • No test files were modified

…packages

- Fix User type field name: userName → username (shared/types.ts)
- Implement paginate() utility with proper slicing and metadata (shared/utils/pagination.ts)
- Fix auth middleware case-sensitivity: normalize HTTP method to uppercase (api/middleware/auth.ts)
- Fix missing import and field name usage in users route handler (api/routes/users.ts)
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