Monday, April 3, 2017

Resolving fetchMock issues when testing isomorphic-fetch [Reactjs]

Hi peeps,

This is a quickie, and the content is totally reactjs.
If you are using fetchMock to simulate your API requests and you happend to use isomorphic-fetch for better support of fetch in browsers, you might have noticed that how fetchMock doesn't work. The solution is that you have to change the isomorphic-fetch import as below

import fetch from isomorphic-fetch

should be changed to

import isomorphic-fetch

This is highlighted in the fetchMock documentation.

No comments:

Post a Comment