Skip to content

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

Open
stooit wants to merge 1 commit into
mainfrom
quantcode/e2e-tier1-2241-1780158657
Open

fix: resolve all 16 failing tests across 5 utility modules#189
stooit wants to merge 1 commit into
mainfrom
quantcode/e2e-tier1-2241-1780158657

Conversation

@stooit
Copy link
Copy Markdown
Contributor

@stooit stooit commented May 30, 2026

Summary

  • calculator.ts: Throw Error("Division by zero") when dividing by zero instead of returning Infinity
  • string-utils.ts: Fix wordCount to split on whitespace runs (/\s+/); implement truncate with word-boundary awareness
  • task-manager.ts: Implement remove, update, and sortBy methods
  • date-utils.ts: Use Math.round instead of Math.floor for day calculation in formatRelative
  • validator.ts: Allow long TLDs (2+ chars) in isEmail; allow optional ports in isUrl

Assumptions

  • formatRelative should use Math.round for day rounding (36h → 2 days)
  • truncate truncates at word boundaries when possible, appending "..." which counts toward maxLength
  • sortBy("priority") orders high > medium > low; sortBy("createdAt") oldest first
  • No test files were modified; no new dependencies added

All 60 tests pass.

- calculator: throw Error 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 long TLDs in isEmail, allow 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