jefflau / jest-fetch-mock

Jest mock for fetch
MIT License
882 stars 116 forks source link

Auto enabling in jest config #181

Open JPeer264 opened 3 years ago

JPeer264 commented 3 years ago

It would be nice to have an autoimport in the jest config file like jest-localstorage-mock got it here.

Current config:

{
  setupFiles: ['./anySetup.js']
}

Expected config:

{
  setupFiles: ['jest-fetch-mock']
}

I didn't look into that any closer how to implement (maybe just a default export of a function), but I could go for a PR if that is a valid improvement.

JPeer264 commented 3 years ago

Seems like this already works.