1
0
mirror of https://github.com/whippyshou/mastodon synced 2024-12-28 21:48:22 +09:00
whippy-edition/spec/javascript/setup.js

20 lines
517 B
JavaScript
Raw Normal View History

import { jsdom } from 'jsdom/lib/old-api';
import chai from 'chai';
import chaiEnzyme from 'chai-enzyme';
chai.use(chaiEnzyme());
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',
};