Skip to content

fix: resolve failing tests and type errors across api and shared packages#60

Open
stooit wants to merge 1 commit into
mainfrom
quantcode/e2e-tier2-2441-1781632191
Open

fix: resolve failing tests and type errors across api and shared packages#60
stooit wants to merge 1 commit into
mainfrom
quantcode/e2e-tier2-2441-1781632191

Conversation

@stooit

@stooit stooit commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

Summary

Fixes all failing tests and type errors. bun test22 pass / 0 fail; bunx tsc --noEmitclean (exit 0).

Changes

  • Auth middleware (packages/api/src/middleware/auth.ts): corrected HTTP-method case comparison so POST /users is correctly treated as a public route (case-sensitivity bug).
  • Users route (packages/api/src/routes/users.ts): imported the missing badRequest helper (was throwing ReferenceError); aligned field usage to the shared User type; removed a stale BUG comment.
  • Shared types (packages/shared/src/types.ts): fixed inconsistent User field name so the API package and tests agree.
  • Pagination (packages/shared/src/utils/pagination.ts): implemented paginate() (previously a stub that threw not implemented) — handles page slicing, partial last page, out-of-range pages, empty input, and totalPages rounding.
  • tsconfig (tsconfig.json): added "types": ["bun-types"] so tsc resolves process and bun:test globals.

Verification

  • bun test: 22 passed, 0 failed, 37 assertions
  • bunx tsc --noEmit: no errors

Notes / Assumptions

  • No test files were modified; no new dependencies added (bun-types already present in node_modules).
  • Reviewed for correctness (auth method handling, field-name consistency, pagination edge cases) — clean.

…ages

- auth: correct HTTP-method case comparison so POST /users is public
- users route: import badRequest helper; align to shared User type
- shared: fix inconsistent User field name
- pagination: implement paginate() (was a throwing stub)
- tsconfig: add bun-types so tsc resolves process and bun:test
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