Skip to content

fix: repair failing tests and implement missing utility functions#245

Open
stooit wants to merge 1 commit into
mainfrom
quantcode/e2e-tier1-4893-1783786974
Open

fix: repair failing tests and implement missing utility functions#245
stooit wants to merge 1 commit into
mainfrom
quantcode/e2e-tier1-4893-1783786974

Conversation

@stooit

@stooit stooit commented Jul 11, 2026

Copy link
Copy Markdown
Contributor

Summary

Fixes all 16 failing tests across the utility library and implements the missing functionality. Test suite went from 44 pass / 16 fail → 60 pass / 0 fail. Only source files in src/ were changed — no test files modified, no dependencies added.

Changes

  • src/calculator.tsdivide now throws on division by zero instead of returning Infinity.
  • src/string-utils.tswordCount collapses consecutive whitespace; truncate implemented (word-boundary cut, ... ellipsis counting toward maxLength, returns unchanged when short enough).
  • src/task-manager.ts — implemented remove(id), update(id, changes), and sortBy(field) (priority ordered high > medium > low).
  • src/date-utils.ts — fixed off-by-one in formatRelative (uses Math.round, so 36h → "2 days ago").
  • src/validator.tsisEmail accepts long TLDs (e.g. .museum); isUrl accepts URLs with ports (e.g. http://localhost:3000).
  • Removed stale BUG: comments left over from the fixes.

Verification

  • bun test → 60 pass / 0 fail / 70 expect() calls.
  • Reviewed by the review subagent (verdict: COMMENT, no blockers).

Assumptions

  • Scope limited to what the tests require, per task constraints. Untested edge-case behaviours flagged in review were intentionally left unchanged to avoid regressing passing tests or over-reaching scope.

- calculator: divide now throws on division by zero
- string-utils: wordCount collapses consecutive whitespace; truncate implemented with word-boundary + ellipsis
- task-manager: implement remove, update, and sortBy methods
- date-utils: fix off-by-one in formatRelative (Math.round instead of Math.floor)
- validator: allow long TLDs in isEmail and ports in isUrl
- remove stale BUG comments after fixes

All 60 tests pass (was 44 pass / 16 fail).
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