/**
 * Jest Configuration
 */

module.exports = {
  // Test environment
  testEnvironment: 'node',

  // Setup files to run before tests
  setupFiles: ['<rootDir>/tests/setup.js'],

  // Coverage configuration
  collectCoverageFrom: [
    'src/**/*.js',
    '!src/server.js',
    '!**/node_modules/**',
    '!**/tests/**'
  ],

  // Coverage thresholds (aspirational)
  coverageThreshold: {
    global: {
      branches: 40,
      functions: 35,
      lines: 45,
      statements: 45
    }
  },

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

  // Verbose output
  verbose: true,

  // Test timeout (increased for integration tests)
  testTimeout: 10000
};
