mattermost-mobile/test/fetch_mock.js
Thomas Hopkins 8611b3e28a Use fetch-mock to mock requests in tests (#18)
* Use fetch-mock to mock requests in tests

* Use flag to enable/disable fetch-mock
2016-10-17 14:37:18 -04:00

20 lines
378 B
JavaScript

/* eslint-disable no-empty-function */
// set this to false to allow requests to server in test suite
const MOCK_FETCH = false;
let fetchMock = {
mock: () => {},
delete: () => {},
get: () => {},
head: () => {},
patch: () => {},
post: () => {},
put: () => {}
};
if (MOCK_FETCH) {
fetchMock = require('fetch-mock');
}
export default fetchMock;