Skip to content

fix: resolve all 16 failing tests across utility modules#164

Open
stooit wants to merge 1 commit into
mainfrom
quantcode/job-e2e-tier1-2357-1779436243
Open

fix: resolve all 16 failing tests across utility modules#164
stooit wants to merge 1 commit into
mainfrom
quantcode/job-e2e-tier1-2357-1779436243

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 passed, 16 failed)

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 (36h → "2 days ago")
src/validator.ts Allow TLDs longer than 4 chars in isEmail; support port numbers in isUrl

Assumptions

  • sortBy("priority") uses high > medium > low ordering
  • sortBy("createdAt") sorts oldest first
  • truncate finds the last space before (maxLength - 3) for word-boundary truncation
  • No new dependencies added

…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 longer than 4 chars in isEmail
- validator: support port numbers 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