Skip to content

fix: resolve failing tests across utility library#211

Open
stooit wants to merge 1 commit into
mainfrom
quantcode/e2e-tier1-2448-1781562915
Open

fix: resolve failing tests across utility library#211
stooit wants to merge 1 commit into
mainfrom
quantcode/e2e-tier1-2448-1781562915

Conversation

@stooit

@stooit stooit commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

Summary

Fixes all 16 previously failing tests across 5 source files. All 60 tests now pass (0 fail), and no previously-passing tests were broken.

Changes

  • src/calculator.tsdivide now throws on division by zero (was returning Infinity).
  • src/string-utils.tswordCount handles multiple consecutive spaces; truncate implemented (word-boundary truncation, ellipsis counts toward maxLength, handles strings shorter than the ellipsis).
  • src/task-manager.ts — implemented/completed remove, update, and sortBy (priority high→medium→low, createdAt oldest-first).
  • src/date-utils.ts — fixed off-by-one in formatRelative (round vs floor; 36h reads as "2 days ago").
  • src/validator.tsisEmail accepts long TLDs; isUrl accepts URLs with a port.

Testing

bun test60 pass, 0 fail.

Constraints honoured

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

- calculator: divide now throws on division by zero
- string-utils: fix wordCount for consecutive spaces; implement truncate
- task-manager: implement remove, update, and sortBy
- date-utils: fix off-by-one in formatRelative (round vs floor)
- validator: allow long TLDs in isEmail; accept 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