Frontend TypeScript files use DOM types and are tested separately from the Node.js backend tests. This prevents Jest coverage collection errors when it tries to analyze frontend files in a Node.js environment. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
33 lines
888 B
JavaScript
33 lines
888 B
JavaScript
module.exports = {
|
|
preset: 'ts-jest',
|
|
testEnvironment: 'node',
|
|
roots: ['<rootDir>/src', '<rootDir>/tests'],
|
|
testMatch: [
|
|
'**/__tests__/**/*.+(ts|tsx|js)',
|
|
'**/*.(test|spec).+(ts|tsx|js)'
|
|
],
|
|
transform: {
|
|
'^.+\\.(ts|tsx)$': 'ts-jest'
|
|
},
|
|
collectCoverageFrom: [
|
|
'src/**/*.{ts,tsx}',
|
|
'!src/**/*.d.ts',
|
|
'!src/swagger.ts', // Skip swagger spec file
|
|
'!src/types/**/*', // Skip type definitions
|
|
'!src/server.ts', // Skip main server as it's integration-focused
|
|
'!src/frontend/**/*' // Skip frontend files (use DOM types, tested separately)
|
|
],
|
|
coverageDirectory: 'coverage',
|
|
coverageReporters: ['text', 'lcov', 'html'],
|
|
coverageThreshold: {
|
|
global: {
|
|
branches: 80,
|
|
functions: 80,
|
|
lines: 80,
|
|
statements: 80
|
|
}
|
|
},
|
|
setupFilesAfterEnv: ['<rootDir>/tests/setup.ts'],
|
|
testTimeout: 10000,
|
|
verbose: true
|
|
};
|