open-nomad/ui/app/utils/fetch.js
Michael Lange ba7245247a Prevent using fetch or ReadableStream in tests
Until they can be mocked, they can't be used
2017-11-21 11:22:42 -08:00

9 lines
261 B
JavaScript

import Ember from 'ember';
import fetch from 'fetch';
// The ember-fetch polyfill does not provide streaming
// Additionally, Mirage/Pretender does not support fetch
const fetchToUse = Ember.testing ? fetch : window.fetch || fetch;
export default fetchToUse;