redux-devtools/extension/test/app/setup.js
Nathan Bierema 6782f4ae41
chore(extension): add extension (#658)
* Move extension

* prettier
2020-10-26 08:18:23 -04:00

32 lines
740 B
JavaScript

require('babel-register')();
require('babel-polyfill');
global.chrome = require('sinon-chrome');
var jsdom = require('jsdom').jsdom;
var exposedProperties = ['window', 'navigator', 'document'];
global.document = jsdom('');
global.window = document.defaultView;
Object.keys(document.defaultView).forEach((property) => {
if (typeof global[property] === 'undefined') {
exposedProperties.push(property);
global[property] = document.defaultView[property];
}
});
global.navigator = {
userAgent: 'gecko',
};
global.document.createRange = function () {
return {
setEnd: function () {},
setStart: function () {},
getBoundingClientRect: function () {
return { right: 0 };
},
};
};
documentRef = document;