mattermost-mobile/test/fetch_mock.js
Thomas Hopkins 829972694b Add functionality for fetching + selecting teams & channels (#17)
* WIP-working-routes

* Fix imports

* WIP

* Remove unused proptypes & imports from SelectTeam

* Appease eslint

* Disable non-applicable eslint rules in routes & styles

* Change endpoint for fetching teams

* Handle failure to fetch teams

* Fix proptypes in ErrorText

* Add action for selecting team

* Allow user to select a channel

* Save exact versions of npm packages

* Add lodash

* Fetch teams for user to select from

* Don't require onProceed prop on SelectServer

* Abstract out the api logic from actions

* Handle fetch implementation discrepancy when parsing headers

* Remove example components

* Appease eslint

* Fix disabling of fetch-mock

* Remove response headers parsing hack

* Set mock fetch flag in config.json
2016-10-17 15:47:47 -04:00

21 lines
424 B
JavaScript

/* eslint-disable no-empty-function */
import config from 'config/config';
const {MockFetchInTests} = config;
let fetchMock = require('fetch-mock');
if (!MockFetchInTests) {
fetchMock.restore();
fetchMock = {
mock: () => {},
delete: () => {},
get: () => {},
head: () => {},
patch: () => {},
post: () => {},
put: () => {}
};
}
export default fetchMock;