jefflau / jest-fetch-mock

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

Compatibility with node-fetch 2.6.1 #177

Open ldiqual opened 3 years ago

ldiqual commented 3 years ago

After updating node-fetch to 2.6.1, it seems that mocks are no longer working.

Here's the diff that I think is causing the issue: https://github.com/node-fetch/node-fetch/compare/v2.6.0...v2.6.1

joelpoloney commented 3 years ago

I think @ldiqual is referring to these lines: https://github.com/node-fetch/node-fetch/compare/v2.6.0...v2.6.1#diff-de1a5a7de991855714cdf433e9f8be96R19-R21

Putting in a code block because Github strips the hash from links 🤷‍♂️

p10ns11y commented 3 years ago

I have tried https://classic.yarnpkg.com/en/docs/selective-version-resolutions/

Screenshot 2021-01-29 at 15 12 05

All the tests were passing which includes mocking fetch

Screenshot 2021-01-29 at 15 14 39

joelpoloney commented 3 years ago

Ah, that works! Thank you @p10ns11y!

yinzara commented 3 years ago

I think @ldiqual is referring to these lines: https://github.com/node-fetch/node-fetch/compare/v2.6.0...v2.6.1#diff-de1a5a7de991855714cdf433e9f8be96R19-R21

Putting in a code block because Github strips the hash from links 🤷‍♂️

I'm unsure how any of those changes could have broken jest-fetch-mock. Do you have anything specific you're thinking? Also can you please share the actual error that's occurring or the problem you're facing?