Skip to content

fix: resolve all failing tests across utility library#160

Open
stooit wants to merge 1 commit into
mainfrom
quantcode/job-e2e-tier1-2377-1779433342
Open

fix: resolve all failing tests across utility library#160
stooit wants to merge 1 commit into
mainfrom
quantcode/job-e2e-tier1-2377-1779433342

Conversation

@stooit
Copy link
Copy Markdown
Contributor

@stooit stooit commented May 22, 2026

Summary

  • calculator.ts: Throw error on division by zero instead of returning Infinity
  • string-utils.ts: Fix wordCount to handle multiple consecutive spaces; implement truncate function with word-boundary truncation
  • task-manager.ts: Implement remove, update, and sortBy methods
  • date-utils.ts: Use Math.round for days calculation in formatRelative (fixes off-by-one at 36 hours)
  • validator.ts: Allow long TLDs (e.g. .museum) in isEmail; allow port numbers in isUrl

Testing

All 60 tests pass, 0 failures. No test files were modified.

Assumptions

  • formatRelative days calculation uses Math.round (test expects 36h → "2 days ago")
  • truncate truncates at last word boundary within maxLength - 3, appends "..."
  • sortBy("priority") orders high > medium > low
  • sortBy("createdAt") orders oldest first

- calculator: throw error on division by zero instead of returning Infinity
- string-utils: fix wordCount for multiple spaces, implement truncate function
- task-manager: implement remove, update, and sortBy methods
- date-utils: use Math.round for days in formatRelative (fixes off-by-one)
- 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