Cycle, Rinse, Repeat
OK, here is test number two. This is just like test number one, except now we want to enter two numbers in our calculator, and ensure that the second number is the one that would show up on our display.
First step is to write a failing test.
OK, good. We’ve got our failing test. Now we just need to make it pass. Which we can by instead returning the last element added to our array and not the first. Like this.
Now we are ready ...
Get The Way of the Web Tester now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.