Skip to content

fix: resolve failing tests and type errors - #285

Open
stooit wants to merge 1 commit into
mainfrom
quantcode/e2e-tier2-2245-1794067919
Open

stooit wants to merge 1 commit into
mainfrom
quantcode/e2e-tier2-2245-1794067919

Conversation

@stooit

@stooit stooit commented Nov 7, 2026

Copy link
Copy Markdown
Contributor

Summary

  • shared/pagination: implemented paginate (slice by page/size; returns data, page, pageSize, total, totalPages).
  • shared/types: renamed User.userName → username to match api usage and tests.
  • api/routes/users: added missing badRequest import.
  • api/middleware/auth: public-methods list compared against uppercase c.req.method; fixed "post" → "POST".
  • tsconfig: added "types": ["bun-types"] (already present in node_modules; no new deps) to resolve bun:test / process types.

bun test: 22 pass / 0 fail. tsc --noEmit: clean. No test files modified.

Assumptions / follow-ups (not changed — out of scope "fix only what tests require")

  • Auth policy follows the middleware's documented intent (GET, POST public). This makes all POST routes public, including POST /posts; consider restricting public POST to /users only.
  • paginate does not validate page < 1 or size <= 0 (no callers yet); consider clamping before wiring to query params.
  • Stale // BUG: comments remain in edited files.

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