How do you design unit tests for a function that calls an external API?

Technical