/** @type {import('ts-jest').JestConfigWithTsJest} */ export default { preset: 'ts-jest', testEnvironment: 'node', testMatch: ['**/*.test.ts'], moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx'], moduleNameMapper: { // Resolve .js imports to .ts source files (ESM convention in TS source) '^(.+)\\.js$': ['$1.ts', '$1.tsx', '$1.js'], // github-slugger v2 is ESM-only; jest's CJS runtime cannot require it. '^github-slugger$': '/__mocks__/github-slugger.js', // Same for the browser ESM build of csv-parse — map to the CJS build. '^csv-parse/browser/esm/sync$': 'csv-parse/sync', }, transform: { '^.+\\.tsx?$': [ 'ts-jest', { tsconfig: { target: 'ES2020', module: 'ESNext', moduleResolution: 'node', esModuleInterop: true, strict: true, skipLibCheck: true } } ] } };