Skip to content

fix: resolve all failing tests and type errors#28

Open
stooit wants to merge 1 commit into
mainfrom
quantcode/job-e2e-tier2-2344-1779902207
Open

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

Conversation

@stooit
Copy link
Copy Markdown
Contributor

@stooit stooit commented May 27, 2026

Summary

  • Auth middleware case-sensitivity: The public methods list used lowercase "post" but HTTP methods are uppercase — changed to "POST" so unauthenticated POST requests to public endpoints are correctly allowed.
  • User type field name: Renamed userName to username in the shared User type to match what the API route handlers and tests expect.
  • Missing import: Added badRequest to the import from ../lib/errors in the users route handler.
  • Pagination utility: Implemented the paginate() function in packages/shared/src/utils/pagination.ts to satisfy the existing test expectations.
  • TypeScript config: Added "node" to compilerOptions.types in the root tsconfig.json so process.env resolves without errors.

Verification

  • bun test → 22 tests pass, 0 failures
  • npx tsc --noEmit → 0 type errors

Assumptions

  • No test files were modified
  • No new dependencies were added
  • All fixes are minimal and targeted to what the tests require

- Fix auth middleware case-sensitivity: use 'POST' instead of 'post' in public methods list
- Fix User type field name: rename 'userName' to 'username' for consistency
- Add missing 'badRequest' import in users route handler
- Implement pagination utility (paginate function) per test expectations
- Add node types to tsconfig for process.env 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