Skip to content

fix: resolve all 16 failing tests across 5 source modules#186

Open
stooit wants to merge 1 commit into
mainfrom
quantcode/job-e2e-tier1-2470-1780042364
Open

fix: resolve all 16 failing tests across 5 source modules#186
stooit wants to merge 1 commit into
mainfrom
quantcode/job-e2e-tier1-2470-1780042364

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 consecutive spaces; implement truncate with word-boundary-aware ellipsis
  • task-manager.ts: Implement remove, update, and sortBy methods
  • date-utils.ts: Use Math.round for day calculation in formatRelative (fixes 36h → "2 days ago")
  • validator.ts: Allow long TLDs (e.g. .museum) in isEmail; support ports and localhost in isUrl

Test Results

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

Assumptions

  • truncate uses word-boundary truncation: walks back from maxLength - 3 to find a space, appends ...
  • sortBy("priority") orders high > medium > low
  • sortBy("createdAt") orders oldest first
  • Day rounding in formatRelative uses Math.round (36h = 1.5 days → 2 days)

- calculator: throw Error on division by zero instead of returning Infinity
- string-utils: fix wordCount to handle consecutive 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; support ports/localhost 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