/ libs / typescript / integrations / codex / jest.config.cjs
jest.config.cjs
 1  const path = require('path');
 2  
 3  /** @type {import('ts-jest').JestConfigWithTsJest} */
 4  module.exports = {
 5    preset: 'ts-jest',
 6    testEnvironment: 'node',
 7    roots: ['<rootDir>/tests'],
 8    testMatch: ['**/*.test.ts'],
 9    moduleFileExtensions: ['ts', 'js', 'json', 'node'],
10    modulePaths: [path.resolve(__dirname, '../../node_modules')],
11    transform: {
12      '^.+\\.tsx?$': [
13        'ts-jest',
14        {
15          tsconfig: {
16            target: 'ES2022',
17            module: 'CommonJS',
18            moduleResolution: 'Node',
19            esModuleInterop: true,
20            strict: true,
21            skipLibCheck: true,
22            types: ['jest', 'node'],
23            baseUrl: '.',
24            paths: {
25              '@mlflow/core': ['../../core/src/index.ts'],
26              '@mlflow/core/*': ['../../core/src/*'],
27            },
28          },
29        },
30      ],
31    },
32    moduleNameMapper: {
33      '^@mlflow/core$': '<rootDir>/../../core/src',
34      '^@mlflow/core/(.*)$': '<rootDir>/../../core/src/$1',
35      // Strip .js extensions for ESM → CJS test resolution
36      '^(\\.{1,2}/.*)\\.js$': '$1',
37    },
38    testTimeout: 30000,
39    forceExit: true,
40    detectOpenHandles: true,
41  };