Skip to content

fix: resolve all failing tests across utility library#179

Open
stooit wants to merge 1 commit into
mainfrom
quantcode/job-e2e-tier1-5930-1779640148
Open

fix: resolve all failing tests across utility library#179
stooit wants to merge 1 commit into
mainfrom
quantcode/job-e2e-tier1-5930-1779640148

Conversation

@stooit
Copy link
Copy Markdown
Contributor

@stooit stooit commented May 24, 2026

Summary

  • calculator.ts: Added division-by-zero guard that throws an error instead of returning Infinity
  • string-utils.ts: Fixed wordCount to handle consecutive spaces; implemented truncate with word-boundary logic
  • task-manager.ts: Implemented missing remove, update, and sortBy methods
  • date-utils.ts: Changed formatRelative to use Math.round for day calculation (fixes off-by-one)
  • validator.ts: Extended email regex to allow TLDs longer than 4 chars; extended URL regex to allow port numbers

Testing

All 60 tests pass (bun test). No test files were modified.

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