module.exports = {
  moduleFileExtensions: ['js', 'json', 'ts'],
  rootDir: '.',
  testEnvironment: 'node',
  setupFiles: ['<rootDir>/test/setup-env.ts'],
  testRegex: '.*\\.spec\\.ts$',
  transform: {
    '^.+\\.(t|j)s$': 'ts-jest',
  },
  moduleNameMapper: {
    '^@app/contracts$': '<rootDir>/libs/contracts/src',
    '^@app/events$': '<rootDir>/libs/events/src',
    '^@app/common$': '<rootDir>/libs/common/src',
  },
  collectCoverageFrom: ['src/**/*.(t|j)s'],
  coverageDirectory: './coverage',
  coverageReporters: ['text', 'json-summary', 'lcov'],
  coverageThreshold: {
    global: {
      statements: 90,
      lines: 90,
      functions: 90,
      branches: 40,
    },
    './src/**/*.service.ts': {
      statements: 50,
      lines: 50,
      functions: 50,
      branches: 30,
    },
  },
};
