Skip to content

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

Open
stooit wants to merge 1 commit into
mainfrom
quantcode/e2e-tier2-2487-1782234038
Open

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

Conversation

@stooit

@stooit stooit commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

Summary

Fixes all failing tests (now 22 pass / 0 fail) and eliminates all tsc --noEmit type errors across the api and shared packages.

Changes

  • packages/shared/src/utils/pagination.ts — implemented the paginate() stub (page slicing, total, totalPages, page/pageSize), with guards so totalPages is 0 when total === 0 or size === 0 (no Infinity).
  • packages/shared/src/types.ts — renamed User.userNameUser.username to match the canonical field name the tests expect.
  • packages/api/src/routes/users.ts — added the missing badRequest import and aligned field usage to username.
  • packages/api/src/middleware/auth.ts — fixed a case-sensitivity bug in the public-methods list (postPOST) so POST /users is correctly treated as a public, no-token route.
  • tsconfig.json — added "types": ["bun-types"] to resolve bun:test module and process global type errors (uses the already-installed bun-types; no new dependencies).

Verification

  • bun test → 22 pass, 0 fail (4 files)
  • bunx tsc --noEmit → clean, zero errors

Assumptions

  • The canonical user field is username (all-lowercase), since the tests use it throughout and tests are authoritative / were not modified.
  • No test files were modified and no dependencies were added, per task constraints.

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