lewis,
@lewis@social.lol avatar

@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

  • All
  • Subscribed
  • Moderated
  • Favorites
  • random
  • DreamBathrooms
  • mdbf
  • ethstaker
  • magazineikmin
  • cubers
  • rosin
  • thenastyranch
  • Youngstown
  • InstantRegret
  • slotface
  • osvaldo12
  • kavyap
  • khanakhh
  • Durango
  • megavids
  • everett
  • tacticalgear
  • modclub
  • normalnudes
  • ngwrru68w68
  • cisconetworking
  • tester
  • GTA5RPClips
  • Leos
  • anitta
  • provamag3
  • JUstTest
  • lostlight
  • All magazines