Skip to content

Commit 7f5790a

Browse files
minipuftclaude
andcommitted
fix: resolve TypeScript build errors in CI/CD pipeline
- Separate production and test TypeScript configurations - Create tsconfig.test.json for Jest with proper type definitions - Exclude tests from production build (tsconfig.json includes only src/) - Update Jest configuration to use test-specific TypeScript config - Fix "Cannot find type definition file for 'jest'" compilation error - Fix "Cannot find type definition file for 'node'" production build issue VALIDATION: npm run build now succeeds, test scripts continue working IMPACT: Production builds are clean, test development is properly configured 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent cf47b39 commit 7f5790a

3 files changed

Lines changed: 15 additions & 6 deletions

File tree

server/jest.config.cjs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@ module.exports = {
77
'<rootDir>/tests/**/*.test.ts'
88
],
99
transform: {
10-
'^.+\\.ts$': 'ts-jest'
10+
'^.+\\.ts$': ['ts-jest', {
11+
tsconfig: 'tsconfig.test.json'
12+
}]
1113
},
1214
collectCoverageFrom: [
1315
'dist/**/*.js',
@@ -19,8 +21,6 @@ module.exports = {
1921
testTimeout: 30000,
2022
verbose: true,
2123
maxWorkers: 1,
22-
// Disable setup file for now to avoid ES module issues
23-
// setupFilesAfterEnv: ['<rootDir>/tests/setup.ts'],
2424
// Module resolution
2525
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx'],
2626
// Allow importing .js files from TypeScript

server/tsconfig.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"lib": ["ES2020"],
55
"module": "NodeNext",
66
"moduleResolution": "NodeNext",
7-
"types": ["node", "jest"],
7+
"types": ["node"],
88
"esModuleInterop": true,
99
"allowSyntheticDefaultImports": true,
1010
"forceConsistentCasingInFileNames": true,
@@ -16,6 +16,6 @@
1616
"declaration": true,
1717
"resolveJsonModule": true
1818
},
19-
"include": ["src/**/*", "tests/**/*"],
20-
"exclude": ["node_modules", "dist"]
19+
"include": ["src/**/*"],
20+
"exclude": ["node_modules", "dist", "tests"]
2121
}

server/tsconfig.test.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"extends": "./tsconfig.json",
3+
"compilerOptions": {
4+
"types": ["node", "jest"],
5+
"noEmit": true
6+
},
7+
"include": ["src/**/*", "tests/**/*"],
8+
"exclude": ["node_modules", "dist"]
9+
}

0 commit comments

Comments
 (0)