Skip to content

fix: resolve failing tests and type errors across api and shared - #212

Open
stooit wants to merge 1 commit into
mainfrom
quantcode/e2e-tier2-3353-1791160609
Open

stooit wants to merge 1 commit into
mainfrom
quantcode/e2e-tier2-3353-1791160609

Conversation

@stooit

@stooit stooit commented Oct 5, 2026

Copy link
Copy Markdown
Contributor

Summary

  • shared/pagination: implemented paginate (was a stub) per test contract; clamps page/size to ≥1.
  • api/auth middleware: publicMethods had lowercase "post"; HTTP methods are uppercase, so POST was wrongly 401'd. Fixed to "POST".
  • shared/types: User.userName → username to match API routes and tests.
  • api/routes/users: added missing badRequest import (runtime ReferenceError on invalid POST).
  • tsconfig: added "types": ["bun-types"] (already a devDependency) to resolve bun:test and process.

Verification

bun test → 22 pass / 0 fail; tsc --noEmit → 0 errors.

Assumptions

  • Tests are authoritative; no test files modified, no deps added.
  • POST remaining public (unauthenticated writes) is intentional per auth.test.ts; flagged as a security concern (ISM-1546) worth revisiting outside this fix.

…rname, missing badRequest import, bun-types in tsconfig
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