RealOrangeOne / react-native-mock

A fully mocked and test-friendly version of react native (maintainers wanted)
MIT License
571 stars 153 forks source link

How to mock XMLHttpRequest in react-native #115

Closed xwartz closed 7 years ago

xwartz commented 7 years ago

Solved. node-XMLHttpRequest

RealOrangeOne commented 7 years ago

Generally in a unittest you shouldnt be making API calls at all, they should be completely offline. You should just mock the return from your endpoints and pass that directly into your components