Skip to content

fix: resolve failing tests and implement missing utilities - #354

Open
stooit wants to merge 1 commit into
mainfrom
quantcode/e2e-tier1-2208-1790439506
Open

stooit wants to merge 1 commit into
mainfrom
quantcode/e2e-tier1-2208-1790439506

Conversation

@stooit

@stooit stooit commented Sep 26, 2026

Copy link
Copy Markdown
Contributor

Summary

Fixes all 16 failing tests (now 60 pass / 0 fail; tsc --noEmit clean). No test files or dependencies changed.

  • calculator: divide throws Error("Division by zero") when divisor is 0.
  • date-utils: formatRelative day bucket uses Math.round(abs(hours)/24) so 36h → "2 days ago" (also corrects future-date rounding).
  • string-utils: wordCount splits on /\s+/; truncate implemented (ellipsis counted in maxLength, cuts at word boundary, hard-slices when maxLength <= 3).
  • task-manager: implemented remove, update (partial, returns false for unknown id), sortBy (priority high→medium→low, createdAt oldest-first, status).
  • validator: isEmail accepts TLDs longer than 4 chars; isUrl accepts URLs with ports (http/https scheme allowlist retained).

Assumptions

  • sortBy("status") order (in_progress → pending → completed) is not covered by tests; chosen as a reasonable default.
  • truncate with maxLength <= 3 returns a plain slice without ellipsis (untested edge).

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