Skip to content

fix: resolve all 16 failing tests across utility library#162

Open
stooit wants to merge 1 commit into
mainfrom
quantcode/job-e2e-tier1-2413-1779435164
Open

fix: resolve all 16 failing tests across utility library#162
stooit wants to merge 1 commit into
mainfrom
quantcode/job-e2e-tier1-2413-1779435164

Conversation

@stooit
Copy link
Copy Markdown
Contributor

@stooit stooit commented May 22, 2026

Summary

  • calculator.ts: Throw error on division by zero instead of returning Infinity
  • date-utils.ts: Use Math.round for day calculation in formatRelative (36h → "2 days ago")
  • 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
  • validator.ts: Allow longer TLDs (e.g. .museum) in isEmail; support port numbers in isUrl

Test Results

All 60 tests pass, 0 failures.

Assumptions

  • formatRelative day calculation uses Math.round (test expects 36h = "2 days ago")
  • truncate truncates at word boundaries with "..." suffix within maxLength
  • sortBy("priority") orders high > medium > low
  • No test files were modified; no new dependencies added

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