Skip to content

Add tests to lift coverage above 80%#2

Open
longbiaochen wants to merge 1 commit into
eliottreich:mainfrom
longbiaochen:coverage-uplift-starter
Open

Add tests to lift coverage above 80%#2
longbiaochen wants to merge 1 commit into
eliottreich:mainfrom
longbiaochen:coverage-uplift-starter

Conversation

@longbiaochen

@longbiaochen longbiaochen commented May 27, 2026

Copy link
Copy Markdown

Summary

  • add test coverage for array, date, money, and string utilities
  • cover edge cases for chunking, fees, date helpers, truncation, title casing, and HTML escaping

Verification

  • npm test
  • npm run test:coverage

Coverage summary after this change:

  • Statements: 100%
  • Branches: 97.05%
  • Functions: 100%
  • Lines: 100%

TaskBounty

Copilot AI review requested due to automatic review settings May 27, 2026 07:21

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Adds new Vitest coverage for several utility modules (strings, money, dates, arrays) to validate expected formatting and helper behaviors.

Changes:

  • Expanded strings test suite to cover slugify, truncate, titleCase, and escapeHtml
  • Added new test suites for money, dates, and arrays utility modules
  • Introduced edge-case assertions for non-positive inputs (e.g., chunk size, recipient count, max length, fee rate)

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
src/strings.test.ts Adds tests for additional string helpers and more slugify scenarios
src/money.test.ts Introduces tests for currency formatting, fee rounding, payouts, and even splits
src/dates.test.ts Adds tests for date math helpers (day diffs, weekends, shifting, UTC normalization)
src/arrays.test.ts Adds tests for chunking, deduplication, and grouping logic

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/dates.test.ts
Comment on lines +16 to +21
expect(isWeekend(new Date("2026-05-23T12:00:00Z"))).toBe(true);
expect(isWeekend(new Date("2026-05-24T12:00:00Z"))).toBe(true);
});

it("returns false for weekdays", () => {
expect(isWeekend(new Date("2026-05-25T12:00:00Z"))).toBe(false);
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.

2 participants