module.exports = {
  preset: 'jest-preset-angular',
  rootDir: '.',
  setupFilesAfterEnv: ['<rootDir>/src/setup-jest.ts'],
  testPathIgnorePatterns: ['<rootDir>/node_modules/', '<rootDir>/dist/'],
  testEnvironment: 'jsdom',
  transform: {
    '^.+\\.ts$': 'ts-jest', // Only transform .ts files
  },
  transformIgnorePatterns: [
    '/node_modules/(?!flat)/',
  ],
  moduleNameMapper: {
    '^@app/(.*)$': '<rootDir>/src/app/$1',
    '^@env/(.*)$': '<rootDir>/src/environments/$1',
  },
  // Ajouter cette section pour gérer les warnings Node.js
  testEnvironmentOptions: {
    customExportConditions: ['node', 'node-addons'],
  },

  // Supprimer les warnings de dépréciation
  setupFiles: ['<rootDir>/suppress-deprecation-warnings.js'],
};
