Skip to content

fix: repair failing utility tests across 5 modules#217

Open
stooit wants to merge 1 commit into
mainfrom
quantcode/e2e-tier1-2543-1781716194
Open

fix: repair failing utility tests across 5 modules#217
stooit wants to merge 1 commit into
mainfrom
quantcode/e2e-tier1-2543-1781716194

Conversation

@stooit

@stooit stooit commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

Summary

Fixes all 16 failing tests across the TypeScript utility library. The full suite now passes (60 pass / 0 fail).

Changes

  • calculator.tsdivide() now throws Error("Division by zero") when the divisor is 0 instead of returning Infinity.
  • date-utils.tsformatRelative() uses Math.round (not Math.floor) for hours→days, fixing the off-by-one (36h now renders as "2 days ago").
  • validator.tsisEmail() accepts long TLDs (e.g. user@example.museum); isUrl() accepts URLs with a port (e.g. http://localhost:3000).
  • string-utils.ts — implemented the previously-missing utility functions.
  • task-manager.ts — completed missing/incomplete TaskManager methods.

Verification

  • bun test → 60 pass, 0 fail, 70 expect() calls.
  • Independent review pass: no blockers, no regressions.

Constraints honoured

  • No test files modified.
  • No new dependencies added.
  • Only the changes required by the tests were made.

- calculator: throw on division by zero instead of returning Infinity
- date-utils: round (not floor) hours-to-days in formatRelative
- validator: accept long TLDs in isEmail and ports in isUrl
- string-utils: implement missing utility functions
- task-manager: complete missing/incomplete TaskManager methods
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