jefflau / jest-fetch-mock

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

Docs: add simpler solution to implement (closes #181) #182

Open JPeer264 opened 3 years ago

JPeer264 commented 3 years ago

I did not include automock: false as this is false by default.

(ref: #181)

yinzara commented 3 years ago

This an interesting proposal. I was not aware jest supported this kind of syntax. There is actually additional code changes required so I'll take this myself.

JPeer264 commented 3 years ago

@yinzara the only thing which is missing is a self execution, I guess the fasted would be to enable mocks before exporting the mock.

+ fetch.enableMocks();

module.exports = fetch.default = fetch

Sorry for assuming this already works, I was too much in rush back then.