mirror of
https://github.com/kemko/nomad.git
synced 2026-01-10 12:25:42 +03:00
Prevent using fetch or ReadableStream in tests
Until they can be mocked, they can't be used
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -21,6 +21,11 @@
|
||||
{{content-for "body"}}
|
||||
{{content-for "test-body"}}
|
||||
|
||||
<script>
|
||||
// Spoof a lack of ReadableStream support to use XHRs instead of Fetch
|
||||
window.__ReadableStream = window.ReadableStream;
|
||||
window.ReadableStream = undefined;
|
||||
</script>
|
||||
<script src="/testem.js" integrity=""></script>
|
||||
<script src="{{rootURL}}assets/vendor.js"></script>
|
||||
<script src="{{rootURL}}assets/test-support.js"></script>
|
||||
|
||||
Reference in New Issue
Block a user