How to best mock external API calls from Edge Functions during unit tests?
I am trying to mock an external api call to Hubspot in one of my edge functions, is this possible and what would be the best way to do it?
I am using TS.
I am using the HttpClients fetch to make the call.
3 Replies
i don't know off the top of my head but maybe you can see if an npm module might help. What would you like to see? As in what does you testing/mocking ideally look like?
I think I had a lapse of judgement, I ended up just breaking down the functionality within the edge function and writing tests for that logic which was probably the better approach to begin with.
yeah that makes sense