Skip to content

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

Open
stooit wants to merge 1 commit into
mainfrom
quantcode/job-e2e-tier1-2375-1779436302
Open

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

Conversation

@stooit
Copy link
Copy Markdown
Contributor

@stooit stooit commented May 22, 2026

Summary

  • calculator.ts: Added division-by-zero guard (throws instead of returning Infinity)
  • string-utils.ts: Fixed wordCount to handle multiple consecutive spaces; implemented truncate with word-boundary logic
  • date-utils.ts: Changed Math.floor to Math.round for relative day calculation (fixes off-by-one at 36 hours)
  • task-manager.ts: Implemented remove, update, and sortBy methods
  • validator.ts: Relaxed email TLD regex to allow 2+ chars; added optional port matching to URL regex

Test Results

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

Assumptions

  • sortBy("priority") uses high > medium > low ordering
  • sortBy("createdAt") uses oldest-first (ascending) ordering
  • truncate prefers word-boundary breaks but falls back to hard truncation when no word boundary fits within the limit

- calculator: throw on division by zero instead of returning Infinity
- string-utils: fix wordCount to handle multiple spaces, implement truncate
- date-utils: use Math.round for relative day calculation (off-by-one fix)
- task-manager: implement remove, update, and sortBy methods
- validator: allow long TLDs in email, allow 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