Skip to content

fix: resolve all failing tests and type errors#47

Open
stooit wants to merge 1 commit into
mainfrom
quantcode/e2e-tier2-2472-1781051707
Open

fix: resolve all failing tests and type errors#47
stooit wants to merge 1 commit into
mainfrom
quantcode/e2e-tier2-2472-1781051707

Conversation

@stooit

@stooit stooit commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

Summary

Fixes all failing tests and TypeScript type errors across the api and shared packages. Final state: 22 pass / 0 fail (bun test) and 0 type errors (tsc --noEmit).

Changes

  • Pagination utility (packages/shared/src/utils/pagination.ts): implemented the previously-throwing stub — page slicing, total, totalPages, and page/pageSize fields with empty/out-of-range handling.
  • Shared User type (packages/shared/src/types.ts + packages/api/src/routes/users.ts): renamed the field userNameusername so the source matches what the tests expect (field-name inconsistency between packages).
  • Missing import (packages/api/src/routes/users.ts): added the missing badRequest import that caused a failure.
  • Auth middleware (packages/api/src/middleware/auth.ts): fixed an HTTP-method case-sensitivity bug so public routes (e.g. POST /users) are correctly matched.
  • tsconfig (tsconfig.json): adjusted types so tsc resolves bun:test and process — no new dependencies added.

Verification

  • bun test → 22 pass, 0 fail
  • npx tsc --noEmit → exit 0

Notes / assumptions

  • No test files were modified and no dependencies were added, per task constraints.
  • Field name aligned to username (lowercase) because the test files reference that spelling; source was changed to match the tests.
  • Reviewed by the review agent — fixes confirmed genuine (not test-passing hacks); only trivial stale-comment cleanups applied.

…ages

- Implement pagination utility (was a throwing stub)
- Align shared User type field userName -> username to match tests
- Add missing badRequest import in users route
- Fix HTTP-method case-sensitivity bug in auth middleware for public routes
- Fix tsconfig types so bun:test and process resolve under tsc (no new deps)
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