Skip to content

fix: resolve all failing tests across utility library#187

Open
stooit wants to merge 1 commit into
mainfrom
quantcode/job-e2e-tier1-3187-1780075190
Open

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

Conversation

@stooit
Copy link
Copy Markdown
Contributor

@stooit stooit commented May 29, 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 missing truncate function with word-boundary logic
  • task-manager.ts: Implement missing remove, update, and sortBy methods
  • date-utils.ts: Use Math.round instead of Math.floor for relative day calculation (36h → "2 days ago")
  • validator.ts: Allow TLDs of 2+ characters in isEmail; support port numbers in isUrl

Testing

All 60 tests pass across 5 test files (0 failures).

Assumptions

  • No test files were modified
  • No new dependencies were added
  • All fixes are minimal and targeted to satisfy existing test expectations

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