You're chugging along writing tests, but then you run into a scenario where you need to test a side-effect. Maybe that's a call to a database, or a call to an external HTTP endpoint, or just making sure a function gets called.
Maybe you're not used to setting up tests for these scenarios.
So you do some searching around and figure out you need to use something called "fakes".
But there are different kinds of fakes - spies, stubs, mocks... which do you use?
In this post we'll go over one of those types of fakes - spies - how to use them and when you might want to.