Challenge 2: 100% Coverage, Still Buggy — Possible Solution ==================================================================== CONCRETE EXAMPLE: function calculateDiscount(price, isMember) { if (isMember) { return price * 0.8; // BUG: should be 0.9 per the actual 10% member discount spec } return price; } it("applies a discount for members", () => { const result = calculateDiscount(100, true); expect(result).toBeGreaterThan(0); // a real, but nearly meaningless assertion }); WHY THIS ACHIEVES 100% COVERAGE WHILE MISSING THE BUG ------------------------------ Calling calculateDiscount(100, true) executes BOTH the isMember branch AND the multiplication line — every line and branch inside the function runs at least once during this single test, which is exactly what a line/branch coverage tool measures. From a pure coverage report's perspective, this function is "fully tested." But the assertion — expect(result).toBeGreaterThan(0) — doesn't check the ACTUAL VALUE returned, only that it's a positive number. The real bug (multiplying by 0.8 instead of the correct 0.9, a 20% discount applied instead of the intended 10%) produces a result (80) that is still greater than 0 — so this hollow assertion passes regardless of whether the discount math is correct or wrong. This directly matches this chapter's own point: coverage measures whether a line EXECUTED, never whether the test's ASSERTIONS were strong enough to actually catch a wrong result. A stronger assertion — expect(result).toBe(90) — would have caught this exact bug immediately, using the SAME lines of code, with the SAME 100% coverage number, just a meaningfully different assertion.