Test Spies in Haskell

When testing a web application, you often want to make sure that a certain email would be sent — without actually sending it. How do you test that? Take something like a transactional email: a user signs up, resets their password, or completes a purchase — and your application needs to send a notification. You don’t care how the email gets sent — just that it was triggered correctly. The simplest…