Skip to content

fix: resolve all 16 failing tests in utility library#169

Open
stooit wants to merge 1 commit into
mainfrom
quantcode/job-e2e-tier1-2453-1779437674
Open

fix: resolve all 16 failing tests in utility library#169
stooit wants to merge 1 commit into
mainfrom
quantcode/job-e2e-tier1-2453-1779437674

Conversation

@stooit
Copy link
Copy Markdown
Contributor

@stooit stooit commented May 22, 2026

Summary

  • Fixed 16 failing tests across 5 source files without modifying any test files
  • All 60 tests now pass (previously 44 pass / 16 fail)

Changes

File Fix
src/calculator.ts Throw error on division by zero instead of returning Infinity
src/string-utils.ts Fix wordCount to handle multiple consecutive spaces; implement truncate with word-boundary support
src/task-manager.ts Implement remove, update, and sortBy methods
src/date-utils.ts Use Math.round for day calculation in formatRelative (fixes 36h to 2 days ago)
src/validator.ts Allow TLDs up to 63 chars in email validation; support port numbers in URL validation

Assumptions

  • sortBy priority uses high > medium > low ordering
  • sortBy createdAt sorts oldest first
  • truncate prefers word boundaries but falls back to hard truncation at maxLength-3
  • Division by zero throws a generic Error with message Division by zero

…anager, date-utils, and validator

- calculator: throw error on division by zero instead of returning Infinity
- string-utils: fix wordCount to handle multiple consecutive spaces
- string-utils: implement truncate with word-boundary support
- task-manager: implement remove, update, and sortBy methods
- date-utils: use Math.round for day calculation in formatRelative
- validator: allow TLDs up to 63 chars and URLs with port numbers
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