export default {
  extensionsToTreatAsEsm: ['.jsx', '.ts', '.tsx'],
  transform: {
    '^.+\\.[jt]sx?$': 'babel-jest',
    '^.+\\.css$': './config/jest/cssTransform.mjs',
  },
  transformIgnorePatterns: [
    String.raw`node_modules/(?!(\@azure/msal-react|@testing-library|react-date-range)/)`
  ],
  testEnvironment: 'jest-environment-jsdom',
  fakeTimers: {
    enableGlobally: true,
  },
  verbose: true,
  setupFiles: ['react-app-polyfill/jsdom'],
  setupFilesAfterEnv: ['./src/setupTests.js'],
  testMatch: [
    '<rootDir>/src/**/__tests__/**/*.{js,jsx,ts,tsx}',
    '<rootDir>/src/**/*.{spec,test}.{js,jsx,ts,tsx}',
    '<rootDir>/*.{spec,test}.{js,jsx,ts,tsx}'
  ],
  moduleNameMapper: {
    '^react-native$': 'react-native-web',
    '\\.(css|less|scss|sass)$': 'identity-obj-proxy',
    '^.+\\.module\\.(css|sass|scss|less)$': 'identity-obj-proxy',
    '^react-date-range$': '<rootDir>/__mocks__/react-date-range.js',
    '^react-apexcharts$': '<rootDir>/__mocks__/react-apexcharts.js',
    '\\.(jpg|jpeg|png|gif|svg|webp)$': '<rootDir>/__mocks__/fileMock.js',
  },
  moduleFileExtensions: [
    'web.js', 'js', 'web.ts', 'ts', 'web.tsx', 'tsx', 'json', 'web.jsx', 'jsx', 'node'
  ],
  resetMocks: true,
  coveragePathIgnorePatterns: [
    '/node_modules/',
    String.raw`\.css$`
  ],
  collectCoverageFrom: [
    'src/**/*.{js,jsx}',
    '!src/**/*.test.{js,jsx}',
    '!src/**/*.spec.{js,jsx}',
    '!src/**/__tests__/**',
    '!src/setupTests.js',
    '!src/index.js',
    '!src/mock-data/**'
  ]
};
