lewis, 26 days ago @afilina I've used this before: https://mswjs.io/docs/integrations/node/ It's a bit fiddly to get setup initially, but it does work fairly well. The other way I've done it is to have the calling function/class take a fetchFn, which defaults to native fetch, but for tests I can pass a mocked function in instead
@afilina I've used this before: https://mswjs.io/docs/integrations/node/
It's a bit fiddly to get setup initially, but it does work fairly well.
The other way I've done it is to have the calling function/class take a fetchFn, which defaults to native fetch, but for tests I can pass a mocked function in instead
fetchFn