Skip to content

fix: resolve all failing tests across utility library#188

Open
stooit wants to merge 1 commit into
mainfrom
quantcode/e2e-tier1-2413-1780126346
Open

fix: resolve all failing tests across utility library#188
stooit wants to merge 1 commit into
mainfrom
quantcode/e2e-tier1-2413-1780126346

Conversation

@stooit
Copy link
Copy Markdown
Contributor

@stooit stooit commented May 30, 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 truncate 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
  • validator.ts: Expand email TLD regex to support longer TLDs (e.g. .museum); fix URL regex to handle ports

Testing

All 60 tests pass (bun test). No test files were modified.

Assumptions

  • truncate uses "..." (3 chars) as the ellipsis and counts it toward maxLength
  • sortBy("priority") sorts high > medium > low (descending severity)
  • Division by zero throws a generic Error with message "Division by zero"

- calculator.ts: throw on division by zero instead of returning Infinity
- string-utils.ts: fix wordCount to handle multiple spaces, implement truncate
- task-manager.ts: implement remove, update, and sortBy methods
- date-utils.ts: use Math.round instead of Math.floor for relative days
- validator.ts: fix email TLD regex and URL port handling
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