Skip to content

fix: resolve all 16 failing tests across 5 utility modules#178

Open
stooit wants to merge 1 commit into
mainfrom
quantcode/job-e2e-tier1-2328-1779553759
Open

fix: resolve all 16 failing tests across 5 utility modules#178
stooit wants to merge 1 commit into
mainfrom
quantcode/job-e2e-tier1-2328-1779553759

Conversation

@stooit
Copy link
Copy Markdown
Contributor

@stooit stooit commented May 23, 2026

Summary

  • calculator.ts: divide now throws on division by zero instead of returning Infinity
  • string-utils.ts: Fixed wordCount to handle multiple consecutive spaces; implemented truncate with word-boundary logic
  • task-manager.ts: Implemented remove, update, and sortBy methods
  • date-utils.ts: Fixed off-by-one in formatRelative by using Math.round for day calculation
  • validator.ts: Fixed isEmail to allow long TLDs (2+ chars); fixed isUrl to allow port numbers

Test Results

All 60 tests pass (was 44 pass / 16 fail).

Assumptions

  • truncate truncates at word boundaries so the result including "..." fits within maxLength
  • sortBy("priority") sorts high > medium > low
  • sortBy("createdAt") sorts oldest first
  • Division by zero throws a generic Error("Division by zero")

- calculator: throw on division by zero instead of returning Infinity
- string-utils: fix wordCount for multiple spaces, implement truncate
- task-manager: implement remove, update, and sortBy methods
- date-utils: use Math.round for day calculation in formatRelative
- validator: allow long TLDs in isEmail, allow ports in isUrl
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