Skip to content

fix: resolve all failing tests in utility library#230

Open
stooit wants to merge 1 commit into
mainfrom
quantcode/e2e-tier1-2449-1782664433
Open

fix: resolve all failing tests in utility library#230
stooit wants to merge 1 commit into
mainfrom
quantcode/e2e-tier1-2449-1782664433

Conversation

@stooit

@stooit stooit commented Jun 28, 2026

Copy link
Copy Markdown
Contributor

Summary

Fixes all 16 failing tests across 5 utility modules. Suite now passes 60/60 (0 failures). No test files were modified and no dependencies were added.

Changes

  • calculator.tsdivide now throws on division by zero instead of returning Infinity.
  • date-utils.tsformatRelative rounds hours→days (Math.round) fixing an off-by-one (36h now reports "2 days ago").
  • string-utils.tswordCount handles multiple consecutive spaces; truncate implemented (within-limit passthrough, word-boundary truncation, ellipsis counted toward maxLength, short-string handling).
  • task-manager.ts — implemented remove (returns false for unknown id), update (title/priority, false for unknown id), and sortBy (priority high→medium→low, createdAt oldest-first).
  • validator.tsisEmail accepts long TLDs (e.g. .museum); isUrl accepts URLs with a port.

Verification

bun test → 60 pass, 0 fail.

Assumptions

  • Expected behaviour and method signatures were derived from the existing tests; only source changes required to satisfy them were made.

- calculator: throw on division by zero instead of returning Infinity
- date-utils: round hours-to-days in formatRelative (off-by-one fix)
- string-utils: fix wordCount whitespace handling; implement truncate
- task-manager: implement remove, update, and sortBy methods
- validator: support long TLDs in isEmail and 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