Skip to content

fix: resolve all failing tests and type errors#7

Open
stooit wants to merge 1 commit into
mainfrom
quantcode/job-e2e-tier2-2332-1779435240
Open

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

Conversation

@stooit
Copy link
Copy Markdown
Contributor

@stooit stooit commented May 22, 2026

Summary

  • Implement paginate() utility in packages/shared/src/utils/pagination.ts — was a stub throwing "not implemented"
  • Fix User type field name in packages/shared/src/types.ts — changed userName to username to match test expectations
  • Fix auth middleware case-sensitivity in packages/api/src/middleware/auth.ts — HTTP method comparison now case-insensitive so POST routes correctly bypass auth
  • Fix missing helper in users route in packages/api/src/routes/users.ts — added inline badRequest response helper
  • Add bun-types to tsconfig — enables proper type resolution for bun:test and process globals

Verification

All 22 tests pass (bun test) and tsc --noEmit exits cleanly with zero errors.

Assumptions

  • The bun-types package was already installed in node_modules (no new dependency added)
  • The process global declaration was removed from auth.ts in favour of the tsconfig types fix
  • badRequest was implemented inline as a simple 400 JSON response helper since no shared utility existed

- Implement paginate() utility in shared package
- Fix User type field name: userName -> username for consistency
- Fix auth middleware case-sensitivity bug for HTTP method matching
- Add missing badRequest helper import in users route
- 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