diff --git a/ui/app/utils/fetch.js b/ui/app/utils/fetch.js index 468f1b523..98b81a889 100644 --- a/ui/app/utils/fetch.js +++ b/ui/app/utils/fetch.js @@ -1,6 +1,8 @@ +import Ember from 'ember'; import fetch from 'fetch'; // The ember-fetch polyfill does not provide streaming -const fetchToUse = window.fetch || fetch; +// Additionally, Mirage/Pretender does not support fetch +const fetchToUse = Ember.testing ? fetch : window.fetch || fetch; export default fetchToUse; diff --git a/ui/tests/index.html b/ui/tests/index.html index acb2855aa..86ae48892 100644 --- a/ui/tests/index.html +++ b/ui/tests/index.html @@ -21,6 +21,11 @@ {{content-for "body"}} {{content-for "test-body"}} +