Commit b53e74be authored by Romain Courteaud's avatar Romain Courteaud

[jio] Fix XMLHttpRequest global

sinon now correctly replace it only on demand.
parent f9cfbc47
...@@ -220,8 +220,8 @@ ...@@ -220,8 +220,8 @@
}(window, WeakMap, ArrayBuffer, Uint8Array)); }(window, WeakMap, ArrayBuffer, Uint8Array));
var XMLHttpRequest = global.XMLHttpRequest || module.exports, global.XMLHttpRequest = module.exports;
Blob = window.Blob, var Blob = window.Blob,
atob = window.atob, atob = window.atob,
btoa = window.btoa, btoa = window.btoa,
FileReader = window.FileReader, FileReader = window.FileReader,
......
...@@ -21,15 +21,14 @@ ...@@ -21,15 +21,14 @@
(function (require, global, Object) { (function (require, global, Object) {
"use strict"; "use strict";
var sinon = require('./sinon-require'), var sinon,
jIO; jIO = require('../../dist/jio-latest-node');
global.sinon = sinon;
global.XMLHttpRequest = sinon.FakeXMLHttpRequest;
jIO = require('../../dist/jio-latest-node');
global.jIO = jIO; global.jIO = jIO;
Object.keys(jIO.node_env).forEach(function (key) { Object.keys(jIO.node_env).forEach(function (key) {
global[key] = jIO.node_env[key]; global[key] = jIO.node_env[key];
}); });
sinon = require('./sinon-require');
global.sinon = sinon;
}(require, global, Object)); }(require, global, Object));
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment