export default {
  testEnvironment: 'jsdom',

  // Coverage configuration
  coverageThreshold: {
    global: {
      statements: 90,
      branches: 85,
      functions: 90,
      lines: 90
    },
    // Higher thresholds for critical components
    './js/game/': {
      statements: 95,
      branches: 90,
      functions: 95,
      lines: 95
    },
    './js/pieces/': {
      statements: 95,
      branches: 90,
      functions: 95,
      lines: 95
    },
    './js/moves/': {
      statements: 95,
      branches: 90,
      functions: 95,
      lines: 95
    }
  },

  collectCoverageFrom: [
    'js/**/*.js',
    '!js/main.js',
    '!**/node_modules/**',
    '!**/tests/**',
    '!**/*.config.js'
  ],

  coverageDirectory: 'coverage',
  coverageReporters: ['text', 'lcov', 'html', 'json-summary'],

  // Test setup
  setupFilesAfterEnv: ['<rootDir>/tests/setup.js'],

  // Test patterns
  testMatch: [
    '**/tests/**/*.test.js',
    '**/__tests__/**/*.js'
  ],

  // Transform ES modules with Babel
  transform: {
    '^.+\\.js$': 'babel-jest'
  },

  // Module configuration
  moduleFileExtensions: ['js', 'json'],

  // Verbose output
  verbose: true,

  // Test timeout
  testTimeout: 10000
};
