-
Notifications
You must be signed in to change notification settings - Fork 21
Expand file tree
/
Copy pathsetup.js
More file actions
28 lines (20 loc) · 668 Bytes
/
Copy pathsetup.js
File metadata and controls
28 lines (20 loc) · 668 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
// taken from https://github.com/lelandrichardson/enzyme-example-mocha/blob/master/test/.setup.js
require('babel-core/register')();
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: 'node.js'
};
documentRef = document;
function noop() {
return null;
}
require.extensions['.less'] = noop;