Files
superset2/superset/assets/spec/helpers/browser.js
Maxime Beauchemin a471afe206 [sql lab] improvements to the left panel (#2709)
* [sql lab] improvements to the left panel

* better error handling with error notifications
* table is added instantly with a loading image

* Fixing tests

* Fixed tests
2017-05-09 13:36:10 -07:00

41 lines
1.1 KiB
JavaScript

/* eslint no-undef: 0, no-native-reassign: 0 */
import 'babel-polyfill';
import chai from 'chai';
import jsdom from 'jsdom';
require('babel-register')();
const exposedProperties = ['window', 'navigator', 'document'];
global.jsdom = jsdom.jsdom;
global.document = global.jsdom('<!doctype html><html><body></body></html>');
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: 'node.js',
platform: 'linux',
appName: 'Netscape',
};
// Configuration copied from https://github.com/sinonjs/sinon/issues/657
// allowing for sinon.fakeServer to work
global.window = global.document.defaultView;
global.XMLHttpRequest = global.window.XMLHttpRequest;
global.sinon = require('sinon');
global.expect = chai.expect;
global.assert = chai.assert;
global.sinon.useFakeXMLHttpRequest();
global.window.XMLHttpRequest = global.XMLHttpRequest;
global.$ = require('jquery')(global.window);