You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

19 lines
517 B

  1. import { jsdom } from 'jsdom/lib/old-api';
  2. import chai from 'chai';
  3. import chaiEnzyme from 'chai-enzyme';
  4. chai.use(chaiEnzyme());
  5. var exposedProperties = ['window', 'navigator', 'document'];
  6. global.document = jsdom('');
  7. global.window = document.defaultView;
  8. Object.keys(document.defaultView).forEach((property) => {
  9. if (typeof global[property] === 'undefined') {
  10. exposedProperties.push(property);
  11. global[property] = document.defaultView[property];
  12. }
  13. });
  14. global.navigator = {
  15. userAgent: 'node.js',
  16. };