summaryrefslogtreecommitdiffstats
path: root/server/sonar-web/tests/jsdom-setup.js
blob: e911cbeb95bdbc5a4763d5483970be5df904421b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
/* globals global: false */

var jsdom = require('jsdom');

// A super simple DOM ready for React to render into
// Store this DOM and the window in global scope ready for React to access
global.document = jsdom.jsdom('<!doctype html><html><body></body></html>');
global.window = document.defaultView;
global.navigator = document.defaultView.navigator;

global.window.baseUrl = '';
global.window.t = global.window.tp = function () {
  var args = Array.prototype.slice.call(arguments, 0);
  return args.join('.');
};