// we always make sure 'react-native' gets included first
import 'react-native';
import Enzyme from 'enzyme';
import Adapter from 'enzyme-adapter-react-16';
import { WebSocket } from 'mock-socket';

// libraries to mock
import './mocks/modules';

// Enzyme config
Enzyme.configure({ adapter: new Adapter() });

// pass an instance of jest to `enableHooks()`
jest.useFakeTimers();

// Websockets
// @ts-ignore
global.WebSocket = WebSocket;

// Needed by Apollo HttpLink
global.fetch = require('node-fetch');

// logger
// eslint-disable-next-line @typescript-eslint/no-empty-function
const noop = () => {};
global.logger = {
  error: noop,
  group: noop,
  groupEnd: noop,
  info: noop,
  log: noop,
  table: noop,
  warn: noop,
};
