It turns out that spies are pretty simple to use when they are replacing global functions or when we can pass in the spy as a constructor argument.
But one occasion that it’s difficult to do this is when dealing with named exports that the application code imports and loads. This is often the case with component frameworks like React.