Skip to content

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

Open
stooit wants to merge 1 commit into
mainfrom
quantcode/job-e2e-tier1-2370-1779432769
Open

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

Conversation

@stooit
Copy link
Copy Markdown
Contributor

@stooit stooit commented May 22, 2026

Summary

  • calculator.ts: divide now throws Error("Division by zero") when divisor is 0
  • string-utils.ts: Fixed wordCount to handle multiple consecutive spaces; implemented truncate with word-boundary logic
  • task-manager.ts: Implemented remove, update, and sortBy methods
  • date-utils.ts: Fixed off-by-one in formatRelative by using Math.round instead of Math.floor for day calculation
  • validator.ts: Fixed isEmail to allow long TLDs (e.g. .museum); fixed isUrl to allow port numbers

Test Results

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

Assumptions

  • No test files were modified
  • No new dependencies were added
  • All fixes are minimal and targeted to the specific test expectations

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