You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
tests/revenue-money.test.ts checks formatMoney output for USD, JPY and KWD. Nothing tests the conversion helpers in src/components/money.ts: toMinor, fromMinor, minorDigits and minorStep. These turn what a user types into stored minor units, so a rounding bug silently changes deal values.
Done when
Tests cover each helper for a two-decimal (USD), zero-decimal (JPY) and three-decimal (KWD) currency, plus rounding of inputs with too many decimals and empty or invalid input.
They live in tests/revenue-money.test.ts or a new tests/money.test.ts, and bun run test passes.
I would like to work on this. I will add focused tests for the money helpers covering USD, JPY and KWD/BHD, including excess-decimal rounding, and run the required checks. I plan to use AI assistance for implementation, with manual review and test verification. Please let me know if that conflicts with your contribution policy or if someone is already working on it.
Activity
Ehtasham-Yasin commentedon Oct 6, 2026
I would like to work on this. I will add focused tests for the money helpers covering USD, JPY and KWD/BHD, including excess-decimal rounding, and run the required checks. I plan to use AI assistance for implementation, with manual review and test verification. Please let me know if that conflicts with your contribution policy or if someone is already working on it.
[-]Add unit tests for the money helpers[/-][+]Test the money conversion helpers[/+]