- Refactored Jest configuration for improved ESM and TypeScript support - Updated `jest.setup.ts` with comprehensive test environment configuration - Enhanced mocking for WebSocket, console, and external dependencies - Adjusted package.json dependencies and scripts - Updated tsconfig.json with decorator and test exclusion settings - Improved test coverage configuration and reporting - Simplified test file structure and mocking strategies
21 lines
577 B
JavaScript
21 lines
577 B
JavaScript
/** @type {import('jest').Config} */
|
|
module.exports = {
|
|
preset: 'ts-jest',
|
|
testEnvironment: 'node',
|
|
moduleNameMapper: {
|
|
'^(\\.{1,2}/.*)\\.js$': '$1',
|
|
},
|
|
transform: {
|
|
'^.+\\.tsx?$': ['ts-jest', {
|
|
useESM: true
|
|
}]
|
|
},
|
|
extensionsToTreatAsEsm: ['.ts'],
|
|
setupFilesAfterEnv: ['<rootDir>/jest.setup.ts'],
|
|
testMatch: ['**/__tests__/**/*.test.ts'],
|
|
collectCoverage: true,
|
|
coverageDirectory: 'coverage',
|
|
transformIgnorePatterns: [
|
|
'node_modules/(?!(chalk|#ansi-styles|#supports-color)/)'
|
|
]
|
|
};
|