Let's finish this chapter by giving some consideration to testing for pipelined or composed functions. Given that the mechanism for both operations is similar, we will look at examples of both. They won't differ, other than their logical differences due to the left-to-right or right-to-left order of function evaluation.
When it comes to pipelining, we can start by looking at how to test the pipeTwo() function since the setup will be similar to pipeline(). We need to create some spies and check whether they were called the correct number of times and whether they received the correct arguments each time. We will set the spies so that they provide a known answer to a call. By doing this, we can check whether the output ...