jest.config.js•969 B
/** @type {import('jest').Config} */
export default {
preset: 'ts-jest/presets/default-esm',
extensionsToTreatAsEsm: ['.ts'],
testEnvironment: 'node',
roots: ['<rootDir>/src', '<rootDir>/tests'],
testMatch: [
'**/__tests__/**/*.test.ts',
'**/?(*.)+(spec|test).ts'
],
transform: {
'^.+\\.ts$': ['ts-jest', {
useESM: true,
}],
},
moduleNameMapper: {
'^(\\.{1,2}/.*)\\.js$': '$1',
'^@modelcontextprotocol/sdk/types.js$': '<rootDir>/tests/mocks/mcp-types.ts',
},
transformIgnorePatterns: [
'node_modules/(?!(@modelcontextprotocol)/)',
],
collectCoverageFrom: [
'src/**/*.ts',
'!src/**/*.d.ts',
'!src/index.ts',
],
coverageDirectory: 'coverage',
coverageReporters: ['text', 'lcov', 'html'],
coverageThreshold: {
global: {
branches: 35,
functions: 60,
lines: 45,
statements: 45,
},
},
setupFilesAfterEnv: ['<rootDir>/tests/setup.ts'],
testTimeout: 10000,
};