mirror of
https://github.com/lunaisnotaboy/mastodon.git
synced 2024-11-18 04:43:24 +00:00
39ea5c0e2e
- Upgrade dependencies - chai (3.5.0 -> 4.0.1) - chai-enzyme (0.6.1 -> 0.7.1) - sinon (2.2.0 -> 2.3.2) - Change extensions from .jsx to .js - Don't assign `React` to `global` - Check code format using ESLint
20 lines
517 B
JavaScript
20 lines
517 B
JavaScript
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',
|
|
};
|