Skip to content

fix: resolve all failing tests across utility library#193

Open
stooit wants to merge 1 commit into
mainfrom
quantcode/e2e-tier1-2425-1780452481
Open

fix: resolve all failing tests across utility library#193
stooit wants to merge 1 commit into
mainfrom
quantcode/e2e-tier1-2425-1780452481

Conversation

@stooit
Copy link
Copy Markdown
Contributor

@stooit stooit commented Jun 3, 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 remove, update, and sortBy methods
  • date-utils.ts: Use Math.round for days calculation so 36 hours displays as "2 days ago"
  • validator.ts: Allow longer TLDs (e.g. .museum) in email validation; support port numbers in URL validation

Testing

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

Assumptions

  • truncate uses word-boundary truncation: if the string exceeds maxLength, it truncates to the last space that fits within maxLength - 3 and appends "...". If no word boundary fits, it hard-truncates at maxLength - 3.
  • sortBy("priority") orders high > medium > low (descending severity).
  • sortBy("createdAt") orders oldest first (ascending).

- calculator.ts: throw error 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 for days calculation (36h → 2 days ago)
- validator.ts: allow longer TLDs in email, support ports in URL validation
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