module.exports = {
  displayName: 'portal-bff',
  preset: '../../jest.preset.js',
  testEnvironment: 'node',
  transform: {
    '^.+\\.[tj]s$': ['ts-jest', { tsconfig: '<rootDir>/tsconfig.spec.json' }],
  },
  moduleFileExtensions: ['ts', 'js', 'html'],
  // Several deps ship ESM-only; without an explicit transform
  // exception ts-jest skips node_modules and Jest fails parsing the
  // import statements. Listed by name rather than a broad pattern
  // so each new ESM-only dep is a conscious addition.
  //
  // The pattern walks pnpm's deep layout: any path under
  // `/node_modules/` is ignored UNLESS the path also contains one
  // of the listed package fragments — catches both the hoisted
  // symlink at `node_modules/<pkg>/...` and the pnpm-internal real
  // path at `node_modules/.pnpm/<pkg>@<version>/node_modules/<pkg>/...`.
  //
  //   jose      — JOSE primitives (signed-assertion strategy, PR #138).
  //   @scalar/  — Scalar API reference UI + transitive ESM bits.
  transformIgnorePatterns: ['/node_modules/(?!.*(jose|@scalar/))'],
  coverageDirectory: '../../coverage/apps/portal-bff',
};
