Skip to content

fix: implement missing utilities and fix failing-test edge cases#256

Open
stooit wants to merge 1 commit into
mainfrom
quantcode/e2e-tier1-2417-1784651878
Open

fix: implement missing utilities and fix failing-test edge cases#256
stooit wants to merge 1 commit into
mainfrom
quantcode/e2e-tier1-2417-1784651878

Conversation

@stooit

@stooit stooit commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

Summary

Makes all 60 tests pass (previously 16 failing across 5 files). No test files were modified and no dependencies were added.

Changes

  • calculator.tsdivide() now throws Error("Division by zero") when the divisor is 0.
  • date-utils.ts — fixed formatRelative off-by-one: uses Math.round so e.g. 36 hours ago reads as "2 days ago".
  • string-utils.ts — implemented truncate() (word-boundary truncation with "..." counted toward maxLength; returns unchanged when str.length <= maxLength); fixed related utility edge cases.
  • task-manager.ts — implemented the missing/incomplete TaskManager method(s).
  • validator.ts — fixed isEmail/isUrl edge cases; hardened isUrl to reject whitespace and bare single-char hosts.

Verification

  • bun test60 pass, 0 fail (70 assertions).
  • Independent review pass confirmed correctness; the isUrl tightening was applied per that review while keeping all tests green.

Assumptions

  • Test files are the source of truth for expected behaviour; only src/ was changed.
  • The isUrl hardening goes slightly beyond the minimal fix but improves robustness without breaking any test.

- calculator: throw on division by zero
- date-utils: fix formatRelative off-by-one (Math.round for days)
- string-utils: implement truncate at word boundary; fix isPalindrome case-insensitivity
- task-manager: implement missing update method
- validator: fix isEmail/isUrl edge cases; harden isUrl against whitespace and bare hosts
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