Skip to content

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

Open
stooit wants to merge 1 commit into
mainfrom
quantcode/job-e2e-tier1-2294-1779438602
Open

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

Conversation

@stooit
Copy link
Copy Markdown
Contributor

@stooit stooit commented May 22, 2026

Summary

  • calculator.ts: Added divide-by-zero guard that throws an Error instead of returning Infinity
  • string-utils.ts: Fixed wordCount to handle consecutive whitespace; implemented truncate with word-boundary logic
  • task-manager.ts: Implemented missing remove, update, and sortBy methods
  • date-utils.ts: Changed formatRelative from Math.floor to Math.round for day calculation
  • validator.ts: Updated isEmail regex to allow TLDs longer than 4 chars; updated isUrl regex to support port numbers

Test Results

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

Assumptions

  • truncate uses word-boundary truncation where "..." counts toward maxLength
  • sortBy("priority") orders high > medium > low
  • sortBy("createdAt") orders oldest first
  • No test files were modified
  • No new dependencies were added

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