Files
ruflo/jest.config.js
T
rUvandClaude fd295cda16 🚀 Release: Claude Flow v2.0.0-alpha.62
## 🔒 Security Fixes
- CRITICAL: Removed vulnerable pkg dependency (GHSA-22r3-9w55-cj54)
- Replaced with secure @vercel/ncc alternative
- Security score improved from 55/100 to 75/100
- All npm audit vulnerabilities resolved (0 vulnerabilities)

## 🚀 Infrastructure Improvements
- Re-enabled ALL CI/CD security gates with strict enforcement
- Fixed Jest configuration and test infrastructure
- Fixed 18 TypeScript test files with import issues
- Created comprehensive test utilities

## 🛠️ Code Quality
- Fixed 145 ESLint errors (16% reduction)
- Fixed 15 critical TypeScript errors
- Added development tooling configs

## 📚 Documentation
- Created security audit report
- Created fix summary documentation
- Created functionality review
- Updated GitHub issue #362

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-18 13:35:41 +00:00

69 lines
1.9 KiB
JavaScript

export default {
preset: 'ts-jest/presets/default-esm',
extensionsToTreatAsEsm: ['.ts'],
testEnvironment: 'node',
roots: ['<rootDir>/src', '<rootDir>/tests'],
testMatch: [
'<rootDir>/tests/**/*.test.ts',
'<rootDir>/tests/**/*.test.js',
'<rootDir>/tests/**/*.spec.ts',
'<rootDir>/tests/**/*.spec.js',
'<rootDir>/src/**/*.test.ts',
'<rootDir>/src/**/*.test.js',
'<rootDir>/src/**/*.spec.ts',
'<rootDir>/src/**/*.spec.js'
],
transform: {
'^.+\\.ts$': ['ts-jest', {
useESM: true,
tsconfig: {
module: 'es2022',
moduleResolution: 'node',
allowSyntheticDefaultImports: true,
esModuleInterop: true,
target: 'es2022'
}
}],
'^.+\\.js$': ['babel-jest', {
presets: [['@babel/preset-env', { modules: false }]]
}]
},
moduleNameMapper: {
'^(\\.{1,2}/.*)\\.js$': '$1',
'^~/(.*)$': '<rootDir>/src/$1',
'^@/(.*)$': '<rootDir>/src/$1',
'^@tests/(.*)$': '<rootDir>/tests/$1'
},
modulePathIgnorePatterns: [
'<rootDir>/dist/',
'<rootDir>/bin/',
'<rootDir>/node_modules/'
],
transformIgnorePatterns: [
'node_modules/(?!(chalk|ora|inquirer|nanoid|fs-extra|ansi-styles|ruv-swarm|@modelcontextprotocol)/)'
],
resolver: undefined,
collectCoverageFrom: [
'src/**/*.ts',
'src/**/*.js',
'!src/**/*.d.ts',
'!src/**/*.test.ts',
'!src/**/*.test.js',
'!src/**/*.spec.ts',
'!src/**/*.spec.js'
],
coverageDirectory: 'coverage',
coverageReporters: ['text', 'lcov', 'html'],
setupFilesAfterEnv: ['<rootDir>/jest.setup.js'],
testTimeout: 30000,
verbose: true,
// Enhanced error handling
errorOnDeprecated: false,
// Better module resolution
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json', 'node'],
// Clear mocks between tests
clearMocks: true,
restoreMocks: true,
// Remove deprecated globals configuration
// ts-jest configuration moved to transform options above
};