Skip to content

fix: resolve all failing tests and type errors#38

Open
stooit wants to merge 1 commit into
mainfrom
quantcode/e2e-tier2-2421-1780422250
Open

fix: resolve all failing tests and type errors#38
stooit wants to merge 1 commit into
mainfrom
quantcode/e2e-tier2-2421-1780422250

Conversation

@stooit
Copy link
Copy Markdown
Contributor

@stooit stooit commented Jun 2, 2026

Summary

  • Auth middleware: Fixed case-sensitivity bug in HTTP method comparison — methods are now compared case-insensitively so that public routes (e.g. POST /users) are correctly exempted from authentication
  • Users route: Added missing badRequest import that caused a ReferenceError at runtime
  • Shared types: Renamed userName field to username in the User type to match what the API route handlers and tests expect
  • Pagination utility: Implemented the paginate() function (was a stub throwing "not implemented") — handles page slicing, out-of-range pages, and empty arrays
  • Auth middleware (types): Replaced process.env with a Bun/Node-compatible pattern to eliminate the Cannot find name 'process' TypeScript error

Verification

  • All 22 tests pass (bun test)
  • Zero source-file type errors (npx tsc --noEmit — only test files show errors due to missing bun:test type declarations, which is expected)

Assumptions

  • Test files are the source of truth and were not modified
  • No new dependencies were added

…packages

- Import missing badRequest helper in users route handler
- Fix User type field name (userName → username) in shared types
- Fix auth middleware case-sensitivity bug (method comparison now case-insensitive)
- Replace process.env with globalThis.process?.env for Node types compatibility in auth middleware
- Implement paginate utility function in shared package
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