Skip to content

fix: repair failing tests and type errors across api + shared packages#63

Open
stooit wants to merge 1 commit into
mainfrom
quantcode/e2e-tier2-2609-1781802778
Open

fix: repair failing tests and type errors across api + shared packages#63
stooit wants to merge 1 commit into
mainfrom
quantcode/e2e-tier2-2609-1781802778

Conversation

@stooit

@stooit stooit commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

Summary

Fixes all failing tests and TypeScript errors. bun test -> 22/22 pass; bunx tsc --noEmit -> 0 errors.

Changes

  • packages/shared/src/utils/pagination.ts — Implemented the paginate<T>() stub (was throwing not implemented). Computes total/totalPages (0 for empty input), slices via (page-1)*size, returns data, page, pageSize, total, totalPages. Handles out-of-range pages (empty data) and empty arrays.
  • packages/api/src/middleware/auth.ts — Fixed a case-sensitivity bug in the public-route check so POST /users is correctly treated as public regardless of HTTP method casing. Resolved the Cannot find name 'process' type error.
  • packages/shared/src/types.ts — Aligned the User field name with the contract the tests expect, removing the cross-package inconsistency.
  • packages/api/src/routes/users.ts — Added the missing badRequest import that caused a runtime/type failure.
  • tsconfig.json — Adjusted types/lib config to resolve a type error without adding any dependency.

Constraints honoured

  • No test files modified.
  • No new dependencies added.
  • Changes scoped strictly to what the failing tests required.

Verification

  • bun test -> 22 pass, 0 fail
  • bunx tsc --noEmit -> exit 0

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