Skip to content

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

Open
stooit wants to merge 1 commit into
mainfrom
quantcode/job-e2e-tier1-2369-1779727921
Open

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

Conversation

@stooit
Copy link
Copy Markdown
Contributor

@stooit stooit commented May 25, 2026

Summary

  • calculator.ts: divide now throws Error("Division by zero") when divisor is 0 (was returning Infinity)
  • string-utils.ts: Fixed wordCount to handle consecutive spaces; implemented truncate with word-boundary logic
  • task-manager.ts: Implemented remove, update, and sortBy methods
  • date-utils.ts: Fixed off-by-one in formatRelative by using Math.round for day calculation
  • validator.ts: isEmail now allows TLDs of 2+ chars; isUrl now allows ports

Test Results

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

Assumptions

  • truncate truncates at word boundary when possible, appending "..." within maxLength limit
  • sortBy("priority") orders: high > medium > low
  • sortBy("createdAt") orders oldest first
  • No test files were modified; no new dependencies added

- calculator: throw Error on division by zero instead of returning Infinity
- string-utils: fix wordCount for multiple spaces, implement truncate function
- 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