/** @type {import('ts-jest').JestConfigWithTsJest} */
module.exports = {
  verbose: true,
  preset: 'ts-jest',
  testEnvironment: 'node',
  coverageDirectory: 'coverage',
  restoreMocks: true,
  clearMocks: true,
  globalSetup: '../../tools/jest-setup.js',
  globalTeardown: '../../tools/jest-teardown.js',
  transform: {
    '^.+\\.ts$': 'ts-jest',
    '^.+\\.js$': [
      'ts-jest',
      {
        tsconfig: {
          allowJs: true,
          module: 'commonjs',
          target: 'es2019',
        },
        diagnostics: false,
      },
    ],
  },
  transformIgnorePatterns: ['/node_modules/(?!.*(@scure|@noble)/)'],
  testMatch: ['**/tests/**/*.spec.ts'],
  collectCoverageFrom: ['api/src/**/*.ts'],
};
