Skip to content

fix: resolve failing tests and type errors - #206

Open
stooit wants to merge 1 commit into
mainfrom
quantcode/e2e-tier2-2267-1790785334
Open

stooit wants to merge 1 commit into
mainfrom
quantcode/e2e-tier2-2267-1790785334

Conversation

@stooit

@stooit stooit commented Sep 30, 2026

Copy link
Copy Markdown
Contributor

Summary

  • shared/pagination: implemented paginate() stub per test contract (empty array → totalPages: 0, out-of-range page → empty data).
  • shared/types: renamed User.userName → username to match API routes/db/tests.
  • api/auth middleware: public-method allow-list had "post" instead of "POST"; fixed and normalised c.req.method.toUpperCase() defensively.
  • api/routes/users: added missing badRequest import (ReferenceError on invalid POST).
  • tsconfig.json: added "types": ["bun-types"] (already a devDependency) so test files typecheck.

Results

bun test: 22 pass / 0 fail (was 13/22). bunx tsc --noEmit: 0 errors (was 14). tsc is not on PATH, so bunx tsc was used.

Assumptions

  • Test files untouched; no dependencies added.
  • The tsconfig change is treated as in scope since it fixes type errors without adding deps.

Follow-ups (out of scope)

  • auth.ts falls back to a hardcoded "test-token" when API_TOKEN is unset and uses a non-constant-time compare; should fail closed and use timingSafeEqual.
  • paginate(items, page, 0) yields totalPages: Infinity; no production callers currently.

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