Skip to content

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

Open
stooit wants to merge 1 commit into
mainfrom
quantcode/job-e2e-tier1-4140-1779989166
Open

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

Conversation

@stooit
Copy link
Copy Markdown
Contributor

@stooit stooit commented May 28, 2026

Summary

  • Fixed 16 failing tests across 5 source files, bringing the test suite from 44/60 to 60/60 passing
  • No test files were modified; only source implementations were corrected

Changes

File Fix
src/calculator.ts Throw Error("Division by zero") instead of returning Infinity
src/string-utils.ts Fix wordCount to handle multiple consecutive spaces; implement truncate with word-boundary logic
src/task-manager.ts Implement remove, update, and sortBy methods
src/date-utils.ts Use Math.round for day calculation in formatRelative
src/validator.ts Allow TLDs of 2+ chars in isEmail; support port numbers in isUrl

Assumptions

  • truncate cuts at last word boundary before maxLength - 3 and appends "..."
  • sortBy("priority") orders high > medium > low
  • sortBy("createdAt") orders oldest first
  • sortBy("status") orders todo > in-progress > done

- calculator.ts: throw on division by zero instead of returning Infinity
- string-utils.ts: fix wordCount for multiple spaces, implement truncate
- task-manager.ts: implement remove, update, and sortBy methods
- date-utils.ts: use Math.round for day calculation in formatRelative
- validator.ts: fix isEmail TLD regex, fix isUrl port handling
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