/** @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$': ['babel-jest', { presets: [['@babel/preset-env', { targets: { node: 'current' } }]] }],
  },
  transformIgnorePatterns: [
    'node_modules/(?!.*(@noble|@scure|string-width|strip-ansi|ansi-regex)/)',
  ],
  testMatch: ['**/tests/**/*.spec.ts'],
  collectCoverageFrom: ['api/src/**/*.ts'],
};
