text: /**
   * Copyright (c) Facebook, Inc. and its affiliates.
   *
   * This source code is licensed under the MIT license found in the
   * LICENSE file in the root directory of this source tree.
   *
   * @emails react-core
   */
  
  'use strict';
  /**
   * Change environment support for PointerEvent.
   */
  
  export function hasPointerEvent() {
    return global != null && global.PointerEvent != null;
  }
  
  export function setPointerEvent(bool) {
    global.PointerEvent = bool ? function() {} : undefined;
  }
  
  /**
   * Change environment host platform.
   */
  
  const platformGetter = jest.spyOn(global.navigator, 'platform', 'get');
  
  export const platform = {
    clear() {
      platformGetter.mockClear();
    },
    get() {
      return global.navigator.platform === 'MacIntel' ? 'mac' : 'windows';
    },
    set(name: 'mac' | 'windows') {
      switch (name) {
        case 'mac': {
          platformGetter.mockReturnValue('MacIntel');
          break;
        }
        case 'windows': {
          platformGetter.mockReturnValue('Win32');
          break;
        }
        default: {
          break;
        }
      }
    },
  };
  