mirror of
https://github.com/apache/superset.git
synced 2026-04-16 22:55:52 +00:00
* [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
41 lines
1.1 KiB
JavaScript
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);
|