// jest-dom adds custom jest matchers for asserting on DOM nodes.
// allows you to do things like:
// expect(element).toHaveTextContent(/react/i)
// learn more: https://github.com/testing-library/jest-dom
import '@testing-library/jest-dom/extend-expect'; // import { rest } from 'msw';

import axios from 'axios'; // import { setupServer } from 'msw/node';

import '@testing-library/jest-dom/extend-expect';
import { baseURL } from './utils/base-url-switch';
axios.defaults.baseURL = baseURL; // const server = setupServer(
//   rest.get('/greeting', (req, res, ctx) => {
//     return res(ctx.json({ greeting: 'hello there' }));
//   })
// );
// beforeAll(() => server.listen());
// afterEach(() => server.resetHandlers());
// afterAll(() => server.close());

HTMLCanvasElement.prototype.getContext = jest.fn();
beforeEach(() => {
  jest.spyOn(console, 'error').mockImplementation(() => {});
});
const localStorageMock = {
  getItem: jest.fn(),
  setItem: jest.fn(),
  clear: jest.fn(),
};
global.localStorage = localStorageMock;
