Billing test coverage gapsBilling test coverage gaps
You
Find the weakest test coverage in packages/billing and close the worst gap.
Assistant
Test coverage for packages/billing is 71%. The biggest gaps:
proration.tsat 38%: no tests for mid-cycle downgrades.tax.tsat 52%: EU reverse-charge path is untested.invoice-pdf.tsat 60%: rendering failures are not covered.
I wrote 9 tests for the proration gaps; coverage there is now 84%.
You
What do the new proration tests cover?
Assistant
The 9 tests cover:
- Mid-cycle downgrade with credit carryover
- Downgrade on the last day of the cycle
- Same-day upgrade then downgrade
- Leap-year February cycles
- Zero-amount plans
- Four currency rounding cases
You
Now do the EU reverse-charge path in tax.ts.
Assistant
Reverse-charge needs three cases: valid VAT id, invalid VAT id, and a non-EU buyer. I wrote them and coverage for tax.ts rose from 52% to 79%.
You
Where does the package stand overall?
Assistant
Package coverage is now 77%. Remaining gap is invoice-pdf.ts at 60%, which needs a fixture for the failure path.