text: import jsdom from 'jsdom';
  
  /**
  basic configuration as recommended by enzyme/airbnb:
   https://github.com/airbnb/enzyme/blob/master/docs/guides/jsdom.md
  */
  const localStorage = storageMock();
  const exposedProperties = ['window', 'navigator', 'document'];
  global.document = jsdom.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',
  };
  
  function storageMock() {
    const storage = {};
  
    return {
      setItem(key, value) {
        storage[key] = value || '';
      },
      getItem(key) {
        return storage[key] || null;
      },
      removeItem(key) {
        delete storage[key];
      },
      get length() {
        return Object.keys(storage).length;
      },
      key(i) {
        const keys = Object.keys(storage);
        return keys[i] || null;
      },
    };
  }
  
  