LibreChat/api/jest.config.js
Dustin Healy 5e844a614a fix(ci): add @modelcontextprotocol/ext-apps to jest transformIgnorePatterns and fix import sort
The package ships ESM-only; adding it to the babel-jest transform allow list
lets all three jest configs (api, packages/api, and config which inherits api)
process it correctly. Also sort imports in ToolCallInfo.tsx and
MCPUIResourceCarousel.test.tsx which the CI sort-imports check flagged.
2026-06-23 15:46:38 -07:00

36 lines
1,023 B
JavaScript

const esModules = [
'openid-client',
'oauth4webapi',
'jose',
'@langchain/langgraph',
'@langchain/langgraph-checkpoint',
'@langchain/langgraph-sdk',
'@mistralai/mistralai',
'@modelcontextprotocol/ext-apps',
'uuid',
].join('|');
module.exports = {
testEnvironment: 'node',
clearMocks: true,
roots: ['<rootDir>'],
coverageDirectory: 'coverage',
maxWorkers: '50%',
testTimeout: 30000, // 30 seconds timeout for all tests
setupFiles: ['./test/jestSetup.js', './test/__mocks__/logger.js'],
moduleNameMapper: {
'~/(.*)': '<rootDir>/$1',
'~/data/auth.json': '<rootDir>/__mocks__/auth.mock.json',
'^openid-client/passport$': '<rootDir>/test/__mocks__/openid-client-passport.js',
'^openid-client$': '<rootDir>/test/__mocks__/openid-client.js',
},
transform: {
'\\.[jt]sx?$': [
'babel-jest',
{
presets: [['@babel/preset-env', { targets: { node: 'current' } }]],
},
],
},
transformIgnorePatterns: [`/node_modules/(?!(${esModules})/).*/`],
};