Skip to content

Add unit tests for the bill urgency engine in lib/bills/urgency.ts#492

Open
Skinny001 wants to merge 1 commit into
Remitwise-Org:mainfrom
Skinny001:test/bills-urgency
Open

Add unit tests for the bill urgency engine in lib/bills/urgency.ts#492
Skinny001 wants to merge 1 commit into
Remitwise-Org:mainfrom
Skinny001:test/bills-urgency

Conversation

@Skinny001

Copy link
Copy Markdown

This pull request adds comprehensive unit tests for the bill urgency utilities and makes minor improvements to code consistency and test configuration. The new tests ensure correct behavior for date calculations, urgency status, and day formatting, while the config changes guarantee these tests are picked up by the test runner.

Testing improvements:

  • Added a new test file lib/bills/urgency.test.ts with thorough unit tests for daysDiff, computeUrgency, and computeDaysInfo, covering edge cases like leap years, time zones, and overdue/upcoming logic.

Configuration updates:

  • Updated vitest.config.mts to include all test files under lib/ for test discovery and to exclude them from type checking, ensuring the new tests are run and not type-checked redundantly. [1] [2]

Code consistency:

  • Standardized string quoting style to double quotes in lib/bills/urgency.ts for all urgency-related strings. [1] [2]

close #469

Adds Vitest suite with frozen clock for overdue/due-soon/upcoming
transitions and month/leap boundaries.
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.

Add unit tests for the bill urgency engine in lib/bills/urgency.ts

1 participant