Skip to content

fix: resolve all failing tests across utility modules#200

Open
stooit wants to merge 1 commit into
mainfrom
quantcode/e2e-tier1-2378-1780938998
Open

fix: resolve all failing tests across utility modules#200
stooit wants to merge 1 commit into
mainfrom
quantcode/e2e-tier1-2378-1780938998

Conversation

@stooit

@stooit stooit commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

Summary

Fixes all 16 failing tests across 5 utility modules. The full suite now passes: 60 pass, 0 fail.

Changes

  • calculatordivide now throws on division by zero instead of returning Infinity.
  • string-utils — implemented truncate (returns unchanged within limit, respects the ellipsis budget for short maxLength, trims to a word boundary) and fixed wordCount to handle consecutive/leading/trailing whitespace.
  • task-manager — implemented the missing/incomplete remove, update, and sortBy (priority high→medium→low, and createdAt oldest-first) methods.
  • date-utils — fixed formatRelative off-by-one (rounds instead of flooring, so 36 hours reads "1 day ago").
  • validator — fixed isEmail (long TLDs) and isUrl (URLs with explicit ports).
  • Cleaned up stale BUG: comments that described the now-fixed behaviour.

Verification

  • bun test → 60 pass, 0 fail, 70 expect() calls.
  • No test files modified, no new dependencies added — only src/ implementation changed.
  • Reviewed by the review subagent: no blocking issues.

Assumptions

  • Division by zero should throw (matches the test expectation) rather than return a sentinel value.
  • truncate counts the ellipsis toward maxLength and prefers a word boundary, per the test cases.

- calculator: throw on division by zero
- string-utils: implement truncate (word-boundary, ellipsis budget) and fix wordCount for consecutive spaces
- task-manager: implement remove, update, and sortBy (priority, createdAt)
- date-utils: fix formatRelative off-by-one (round instead of floor)
- validator: fix isEmail (long TLDs) and isUrl (explicit ports)
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