Skip to content

fix: repair failing tests across utility library#247

Open
stooit wants to merge 1 commit into
mainfrom
quantcode/e2e-tier1-5123-1783961575
Open

fix: repair failing tests across utility library#247
stooit wants to merge 1 commit into
mainfrom
quantcode/e2e-tier1-5123-1783961575

Conversation

@stooit

@stooit stooit commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

Summary

Fixes all 16 previously-failing tests across the utility library. Test suite now passes 60/60 (was 44/60), with no changes to test files and no new dependencies.

Changes

  • src/calculator.tsdivide now throws Error("Division by zero") on a zero divisor instead of returning Infinity.
  • src/string-utils.tswordCount handles consecutive/leading/trailing whitespace via trim().split(/\s+/); truncate implemented.
  • src/task-manager.ts — implemented the missing/incomplete TaskManager methods (remove / update / sortBy).
  • src/date-utils.ts — corrected formatRelative off-by-one rounding so relative durations bucket correctly.
  • src/validator.tsisEmail accepts long TLDs (e.g. .museum); isUrl accepts explicit ports (e.g. http://localhost:3000).
  • Refreshed stale BUG: JSDoc comments that described the now-fixed behaviour.

Verification

  • bun test60 pass / 0 fail (70 assertions).
  • Independent review pass (verdict: ship). No test files modified; no dependencies added; changes kept minimal and consistent with existing style.

Assumptions

  • Division by zero should raise an error (matches the failing test expectation) rather than return a sentinel value.
  • isUrl/isEmail relaxations are intentional per the tests; the review noted these widen accepted input but flagged no correctness regression within tested scope.

- calculator: divide throws on division by zero instead of returning Infinity
- string-utils: fix wordCount for consecutive spaces, implement truncate
- task-manager: implement remove/update/sortBy methods
- date-utils: fix formatRelative off-by-one rounding
- validator: isEmail accepts long TLDs, isUrl accepts ports
- refresh stale JSDoc comments describing fixed bugs
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