Skip to content

fix: resolve all failing tests and type errors#71

Open
stooit wants to merge 1 commit into
mainfrom
quantcode/e2e-tier2-2480-1782492612
Open

fix: resolve all failing tests and type errors#71
stooit wants to merge 1 commit into
mainfrom
quantcode/e2e-tier2-2480-1782492612

Conversation

@stooit

@stooit stooit commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

Summary

Fixes all failing tests and TypeScript errors across the api and shared packages. Final state: 22 tests pass, 0 fail; tsc --noEmit clean.

Changes

  • packages/shared/src/utils/pagination.ts — implemented paginate() (was a stub throwing not implemented). Handles page slicing, total/totalPages, page/pageSize, out-of-range pages, empty arrays, and partial last pages per the test contract.
  • packages/api/src/middleware/auth.ts — fixed HTTP method case-sensitivity bug in the public-route check ("post""POST"), so POST /users is correctly treated as public. Also resolved the process global type error.
  • packages/api/src/routes/users.ts — added the missing badRequest import and reconciled the user field name.
  • Shared User type / field naming — reconciled the inconsistent field name to username to match the contract exercised by the (unmodified) tests.
  • tsconfig.json — added bun-types to compilerOptions.types to resolve process and bun:test type-resolution errors. No new dependencies added (bun-types already present).

Verification

  • bun test → 22 pass / 0 fail
  • bunx tsc --noEmit → clean

Constraints honoured

  • No test files modified. No new dependencies added. Changes minimal and scoped to what tests/types require.

Assumptions

  • Where the User field name was inconsistent (userName vs username), the unmodifiable tests are the source of truth, so non-test code was aligned to username.

…ages

- implement paginate() utility in shared (was a throwing stub)
- fix auth middleware HTTP method case-sensitivity ("post" -> "POST")
- add missing badRequest import in users route
- reconcile shared User field name to `username` to match contract
- add bun-types to tsconfig types to resolve process/bun:test globals
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