Executed UTC: 2026-10-10T05:03:10Z Runtime: v24.19.0 $ node test-discount.mjs faulty PASS ordinary exact | amount=1200 rate=20 expected=960 actual=960 PASS ordinary fraction | amount=1999 rate=15 expected=1699 actual=1699 FAIL half-unit boundary | amount=101 rate=50 expected=51 actual=50 50 !== 51 PASS below half-unit | amount=1 rate=51 expected=0 actual=0 FAIL exact half-unit | amount=1 rate=50 expected=1 actual=0 0 !== 1 PASS above half-unit | amount=1 rate=49 expected=1 actual=1 PASS zero amount | amount=0 rate=25 expected=0 actual=0 PASS zero discount | amount=101 rate=0 expected=101 actual=101 PASS full discount | amount=101 rate=100 expected=0 actual=0 PASS maximum amount | amount=1000000000 rate=0 expected=1000000000 actual=1000000000 PASS maximum amount discounted | amount=1000000000 rate=99 expected=10000000 actual=10000000 PASS maximum amount full discount | amount=1000000000 rate=100 expected=0 actual=0 PASS negative amount | amount=-1 rate=20 throws RangeError PASS amount over cap | amount=1000000001 rate=20 throws RangeError PASS fractional amount | amount=1.5 rate=20 throws TypeError PASS blank amount | amount='' rate=20 throws TypeError PASS numeric string amount | amount='101' rate=20 throws TypeError PASS null amount | amount=null rate=20 throws TypeError PASS missing amount | amount=undefined rate=20 throws TypeError PASS boolean amount | amount=true rate=20 throws TypeError PASS array amount | amount=[] rate=20 throws TypeError PASS object amount | amount={} rate=20 throws TypeError PASS NaN amount | amount=NaN rate=20 throws TypeError PASS infinite amount | amount=Infinity rate=20 throws TypeError PASS unsafe integer amount | amount=9007199254740992 rate=20 throws TypeError PASS negative rate | amount=101 rate=-1 throws RangeError PASS rate over cap | amount=101 rate=101 throws RangeError PASS fractional rate | amount=101 rate=12.5 throws TypeError PASS blank rate | amount=101 rate='' throws TypeError PASS numeric string rate | amount=101 rate='50' throws TypeError PASS missing rate | amount=101 rate=undefined throws TypeError PASS NaN rate | amount=101 rate=NaN throws TypeError PASS infinite rate | amount=101 rate=Infinity throws TypeError FAIL repeated calculation A B A | expected=[960,51,960] actual=[960,50,960] + actual - expected [ 960, + 50, - 51, 960 ] PASS valid calculation after invalid input | rejected blank amount, then expected=960 actual=960 SUMMARY implementation=faulty passed=32 failed=3 total=35 EXIT_CODE=1 $ node test-discount.mjs correct PASS ordinary exact | amount=1200 rate=20 expected=960 actual=960 PASS ordinary fraction | amount=1999 rate=15 expected=1699 actual=1699 PASS half-unit boundary | amount=101 rate=50 expected=51 actual=51 PASS below half-unit | amount=1 rate=51 expected=0 actual=0 PASS exact half-unit | amount=1 rate=50 expected=1 actual=1 PASS above half-unit | amount=1 rate=49 expected=1 actual=1 PASS zero amount | amount=0 rate=25 expected=0 actual=0 PASS zero discount | amount=101 rate=0 expected=101 actual=101 PASS full discount | amount=101 rate=100 expected=0 actual=0 PASS maximum amount | amount=1000000000 rate=0 expected=1000000000 actual=1000000000 PASS maximum amount discounted | amount=1000000000 rate=99 expected=10000000 actual=10000000 PASS maximum amount full discount | amount=1000000000 rate=100 expected=0 actual=0 PASS negative amount | amount=-1 rate=20 throws RangeError PASS amount over cap | amount=1000000001 rate=20 throws RangeError PASS fractional amount | amount=1.5 rate=20 throws TypeError PASS blank amount | amount='' rate=20 throws TypeError PASS numeric string amount | amount='101' rate=20 throws TypeError PASS null amount | amount=null rate=20 throws TypeError PASS missing amount | amount=undefined rate=20 throws TypeError PASS boolean amount | amount=true rate=20 throws TypeError PASS array amount | amount=[] rate=20 throws TypeError PASS object amount | amount={} rate=20 throws TypeError PASS NaN amount | amount=NaN rate=20 throws TypeError PASS infinite amount | amount=Infinity rate=20 throws TypeError PASS unsafe integer amount | amount=9007199254740992 rate=20 throws TypeError PASS negative rate | amount=101 rate=-1 throws RangeError PASS rate over cap | amount=101 rate=101 throws RangeError PASS fractional rate | amount=101 rate=12.5 throws TypeError PASS blank rate | amount=101 rate='' throws TypeError PASS numeric string rate | amount=101 rate='50' throws TypeError PASS missing rate | amount=101 rate=undefined throws TypeError PASS NaN rate | amount=101 rate=NaN throws TypeError PASS infinite rate | amount=101 rate=Infinity throws TypeError PASS repeated calculation A B A | expected=[960,51,960] actual=[960,51,960] PASS valid calculation after invalid input | rejected blank amount, then expected=960 actual=960 SUMMARY implementation=correct passed=35 failed=0 total=35 EXIT_CODE=0