Vibe Coding Wallpaper
开始体验
全部场景
从失败到通过

缺陷修复与测试

checkout-webfix/tax-rounding
PROMPT · 0%
智能体推理
从失败金额出发三席位折扣购物车比发票金额高一分钱。
ORIGINAL FAILURE · calculate-checkout-total.test.ts1 assertion failed · line 185,408 ≠ 5,407
EXPECTED5,407 cents$54.07
RECEIVED5,408 cents$54.08

Subtotal5,997¢

Discount1,002¢rounded too early

+

Tax412¢

=

Failing total5,408¢

Tracing the checkout total from cart lines to invoice

round-money.tsDIFF

Math.round((value + Number.EPSILON) * 100) / 100

·Patch pending — failing line preserved above

MONEY INVARIANTCalculate in cents. Round once per line.
RED GREEN
关于此场景

缺陷修复与测试

失败的结账测试暴露金额舍入边界问题,修正实现后,专项测试全部转绿再交付。

适合深度工作、直播背景,也适合静静看着软件逐步成形。

TypeScriptVitest回归修复