Some checks failed
CI/CD Pipeline / Backend - Lint & Test (push) Has been cancelled
CI/CD Pipeline / Frontend - Lint & Test (push) Has been cancelled
CI/CD Pipeline / Security Scan (push) Has been cancelled
CI/CD Pipeline / Build Backend (push) Has been cancelled
CI/CD Pipeline / Build Frontend (push) Has been cancelled
CI/CD Pipeline / Integration Tests (push) Has been cancelled
CI/CD Pipeline / Deploy to Staging (push) Has been cancelled
CI/CD Pipeline / Deploy to Production (push) Has been cancelled
CI/CD Pipeline / Performance Tests (push) Has been cancelled
CI/CD Pipeline / Dependency Updates (push) Has been cancelled
- Updated Anthropic API to latest version (2024-01-01) - Set Claude 3.7 Sonnet Latest as primary model - Removed deprecated Opus 3.5 references - Fixed LLM response validation and JSON parsing - Improved error handling and logging - Updated model configurations and pricing - Enhanced document processing reliability - Fixed TypeScript type issues - Updated environment configuration
173 lines
3.8 KiB
JavaScript
173 lines
3.8 KiB
JavaScript
module.exports = {
|
||
// Test environment
|
||
testEnvironment: 'node',
|
||
|
||
// Test file patterns
|
||
testMatch: [
|
||
'**/__tests__/**/*.(ts|tsx|js)',
|
||
'**/*.(test|spec).(ts|tsx|js)'
|
||
],
|
||
|
||
// File extensions
|
||
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json'],
|
||
|
||
// Transform files
|
||
transform: {
|
||
'^.+\\.(ts|tsx)$': 'ts-jest',
|
||
'^.+\\.(js|jsx)$': 'babel-jest'
|
||
},
|
||
|
||
// Setup files
|
||
setupFilesAfterEnv: [
|
||
'<rootDir>/src/__tests__/setup.ts'
|
||
],
|
||
|
||
// Coverage configuration
|
||
collectCoverage: true,
|
||
collectCoverageFrom: [
|
||
'src/**/*.(ts|tsx|js)',
|
||
'!src/**/*.d.ts',
|
||
'!src/**/*.test.(ts|tsx|js)',
|
||
'!src/**/*.spec.(ts|tsx|js)',
|
||
'!src/__tests__/**',
|
||
'!src/migrations/**',
|
||
'!src/scripts/**',
|
||
'!src/index.ts'
|
||
],
|
||
coverageDirectory: 'coverage',
|
||
coverageReporters: [
|
||
'text',
|
||
'lcov',
|
||
'html',
|
||
'json'
|
||
],
|
||
coverageThreshold: {
|
||
global: {
|
||
branches: 80,
|
||
functions: 80,
|
||
lines: 80,
|
||
statements: 80
|
||
}
|
||
},
|
||
|
||
// Test timeout
|
||
testTimeout: 30000,
|
||
|
||
// Verbose output
|
||
verbose: true,
|
||
|
||
// Clear mocks between tests
|
||
clearMocks: true,
|
||
|
||
// Restore mocks between tests
|
||
restoreMocks: true,
|
||
|
||
// Module name mapping
|
||
moduleNameMapper: {
|
||
'^@/(.*)$': '<rootDir>/src/$1',
|
||
'^@config/(.*)$': '<rootDir>/src/config/$1',
|
||
'^@services/(.*)$': '<rootDir>/src/services/$1',
|
||
'^@models/(.*)$': '<rootDir>/src/models/$1',
|
||
'^@routes/(.*)$': '<rootDir>/src/routes/$1',
|
||
'^@middleware/(.*)$': '<rootDir>/src/middleware/$1',
|
||
'^@utils/(.*)$': '<rootDir>/src/utils/$1',
|
||
'^@types/(.*)$': '<rootDir>/src/types/$1'
|
||
},
|
||
|
||
// Test environment variables
|
||
testEnvironmentOptions: {
|
||
NODE_ENV: 'test'
|
||
},
|
||
|
||
// Global test setup
|
||
globalSetup: '<rootDir>/src/__tests__/globalSetup.ts',
|
||
globalTeardown: '<rootDir>/src/__tests__/globalTeardown.ts',
|
||
|
||
// Projects for different test types
|
||
projects: [
|
||
{
|
||
displayName: 'unit',
|
||
testMatch: [
|
||
'<rootDir>/src/**/__tests__/**/*.test.(ts|tsx|js)',
|
||
'<rootDir>/src/**/*.test.(ts|tsx|js)'
|
||
],
|
||
testPathIgnorePatterns: [
|
||
'<rootDir>/src/__tests__/integration/',
|
||
'<rootDir>/src/__tests__/e2e/',
|
||
'<rootDir>/src/__tests__/performance/'
|
||
]
|
||
},
|
||
{
|
||
displayName: 'integration',
|
||
testMatch: [
|
||
'<rootDir>/src/__tests__/integration/**/*.test.(ts|tsx|js)'
|
||
],
|
||
setupFilesAfterEnv: [
|
||
'<rootDir>/src/__tests__/integration/setup.ts'
|
||
]
|
||
},
|
||
{
|
||
displayName: 'e2e',
|
||
testMatch: [
|
||
'<rootDir>/src/__tests__/e2e/**/*.test.(ts|tsx|js)'
|
||
],
|
||
setupFilesAfterEnv: [
|
||
'<rootDir>/src/__tests__/e2e/setup.ts'
|
||
]
|
||
},
|
||
{
|
||
displayName: 'performance',
|
||
testMatch: [
|
||
'<rootDir>/src/__tests__/performance/**/*.test.(ts|tsx|js)'
|
||
],
|
||
setupFilesAfterEnv: [
|
||
'<rootDir>/src/__tests__/performance/setup.ts'
|
||
]
|
||
}
|
||
],
|
||
|
||
// Watch plugins (commented out - packages not installed)
|
||
// watchPlugins: [
|
||
// 'jest-watch-typeahead/filename',
|
||
// 'jest-watch-typeahead/testname'
|
||
// ],
|
||
|
||
// Notify mode
|
||
notify: true,
|
||
notifyMode: 'change',
|
||
|
||
// Cache directory
|
||
cacheDirectory: '<rootDir>/.jest-cache',
|
||
|
||
// Maximum workers
|
||
maxWorkers: '50%',
|
||
|
||
// Force exit
|
||
forceExit: true,
|
||
|
||
// Detect open handles
|
||
detectOpenHandles: true,
|
||
|
||
// Run tests in band for integration tests (removed invalid option)
|
||
// runInBand: false,
|
||
|
||
// Bail on first failure (for CI)
|
||
bail: process.env.CI ? 1 : 0,
|
||
|
||
// Reporters
|
||
reporters: [
|
||
'default',
|
||
[
|
||
'jest-junit',
|
||
{
|
||
outputDirectory: 'coverage',
|
||
outputName: 'junit.xml',
|
||
classNameTemplate: '{classname}',
|
||
titleTemplate: '{title}',
|
||
ancestorSeparator: ' › ',
|
||
usePathForSuiteName: true
|
||
}
|
||
]
|
||
]
|
||
};
|