1
0
mirror of https://github.com/videojs/video.js.git synced 2024-12-27 02:43:45 +02:00
video.js/test/globals-shim.js
David LaPalomento 24cdbdefff Use Raynos/xhr for XMLHttpRequests
- Get rid of our custom XHR shim. Export it as videojs.xhr.
- Updated XHR to be stubbed everywhere in tests to prevent errors.
- Added npm install to the review process

closes #2318
closes #2594
2015-09-15 15:25:11 -07:00

17 lines
584 B
JavaScript

import document from 'global/document';
import window from 'global/window';
import sinon from 'sinon';
window.q = QUnit;
window.sinon = sinon;
// There's nowhere we require completing xhr requests
// and raynos/xhr doesn't want to make stubbing easy (Raynos/xhr#11)
// so we need to stub XHR before the xhr module is included anywhere else.
window.xhr = sinon.useFakeXMLHttpRequest();
// This may not be needed anymore, but double check before removing
window.fixture = document.createElement('div');
window.fixture.id = 'qunit-fixture';
document.body.appendChild(window.fixture);