In the last lesson, your gap list showed what a green run leaves out. That same result can also mislead you when a change edits the tests themselves. Then the suite checks different examples from the ones Edsger wrote.
So read a change’s test edits before its code. They’re the author’s statement of what “correct” now means, and you can compare it with the intent before the code shapes your opinion. In this lesson, you’ll see only the test changes with one Git command, then judge a real edit and a made-up one. Start with a change that’s already on main.
See Only the Test Changes
A whole diff mixes code, docs, and tests, so test edits can hide in the middle. In the last course, you compared two tags with git diff v1.0 v1.1 -- src/orders/pricing.js. The range v1.5..main, with two dots, compares two versions the same way. A folder after the -- limits the diff to its contents.
Pull request #25 landed on main after v1.5. In your second-draft-books folder, on main, run this:
$ git diff v1.5..main -- test/
diff --git a/test/refunds.test.js b/test/refunds.test.js
index c36c196..1c1578d 100644
--- a/test/refunds.test.js
+++ b/test/refunds.test.js
@@ -14,3 +14,18 @@ test('returning a single paid book restores its stock and payment', () => {
assert.equal(state.stock[0].onHand, 18);
assert.equal(order.status, 'refunded');
});
+
+test('the final paid return receives the remaining rounding penny', () => {
...
+ assert.equal(order.refunded, 1);
+});