Skip to content

fix: implement missing utilities and fix edge-case bugs#196

Open
stooit wants to merge 1 commit into
mainfrom
quantcode/e2e-tier1-2407-1780880125
Open

fix: implement missing utilities and fix edge-case bugs#196
stooit wants to merge 1 commit into
mainfrom
quantcode/e2e-tier1-2407-1780880125

Conversation

@stooit

@stooit stooit commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

Summary

Fixes all 16 previously-failing tests across the utility library. All 60 tests now pass (0 fail) with no new dependencies and no test files modified.

Changes

  • calculator: divide now throws Error("Division by zero") instead of returning Infinity.
  • string-utils: implemented truncate (word-boundary aware, ... suffix) and fixed wordCount to use trim().split(/\s+/) so extra whitespace no longer inflates the count.
  • task-manager: completed missing/incomplete TaskManager methods.
  • date-utils: fixed an off-by-one in relative date formatting.
  • validator: isEmail now accepts long TLDs (e.g. example.museum); isUrl now accepts URLs with ports (e.g. http://localhost:3000).

Verification

  • bun test60 pass, 0 fail

Assumptions

  • "Fix only what the tests require" — source files only were changed; no test files touched and no dependencies added, per task constraints.

- calculator: throw on division by zero
- string-utils: implement truncate and fix wordCount whitespace handling
- task-manager: implement remove, update, and sortBy
- date-utils: fix off-by-one in formatRelative day rounding
- validator: accept 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