Skip to content

fix: resolve all 16 failing tests across utility library#185

Open
stooit wants to merge 1 commit into
mainfrom
quantcode/job-e2e-tier1-2422-1780019620
Open

fix: resolve all 16 failing tests across utility library#185
stooit wants to merge 1 commit into
mainfrom
quantcode/job-e2e-tier1-2422-1780019620

Conversation

@stooit
Copy link
Copy Markdown
Contributor

@stooit stooit commented May 29, 2026

Summary

  • Fixed all 16 failing tests across 5 source files (60/60 tests now pass)
  • No test files modified, no new dependencies added

Changes

File Fix
src/calculator.ts Throw error on division by zero instead of returning Infinity
src/string-utils.ts Fix wordCount to collapse multiple spaces; implement truncate with word-boundary logic
src/task-manager.ts Implement remove, update, and sortBy methods
src/date-utils.ts Use Math.round for day calculation in formatRelative (fixes off-by-one)
src/validator.ts Allow longer TLDs in isEmail; support ports in isUrl regex

Assumptions

  • truncate uses word-boundary truncation where "..." counts toward maxLength
  • sortBy("priority") orders high > medium > low
  • sortBy("createdAt") orders oldest first

…manager, date-utils, and validator

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