module.exports = {
preset: 'ts-jest',
testEnvironment: 'node',
testMatch: [
'**/tests/**/*.test.ts',
'**/tests/**/*.spec.ts'
],
globalSetup: '<rootDir>/tests/global-setup.ts',
globalTeardown: '<rootDir>/tests/global-teardown.ts',
setupFilesAfterEnv: ['<rootDir>/tests/test-setup.ts'],
testTimeout: 30000,
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json', 'node'],
moduleNameMapper: {
'^(\\.{1,2}/.*)\\.js$': '$1',
},
transform: {
'^.+\\.ts$': ['ts-jest', {
tsconfig: {
module: 'esnext',
target: 'es2022',
moduleResolution: 'node',
lib: ['es2022']
}
}]
},
// Run tests sequentially to avoid DDEV Docker container conflicts
maxWorkers: 1,
// Make tests more visible
verbose: true,
detectOpenHandles: true,
forceExit: true,
// Show individual test results
reporters: [
'default',
['jest-junit', {
outputDirectory: 'test-results',
outputName: 'junit.xml',
classNameTemplate: '{classname}',
titleTemplate: '{title}',
ancestorSeparator: ' › ',
usePathForSuiteName: true
}]
]
};