mirror of
https://github.com/danny-avila/LibreChat.git
synced 2026-07-02 12:22:22 +00:00
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.
52 lines
1.3 KiB
JavaScript
52 lines
1.3 KiB
JavaScript
const esModules = [
|
|
'@langchain/langgraph',
|
|
'@langchain/langgraph-checkpoint',
|
|
'@langchain/langgraph-sdk',
|
|
'@mistralai/mistralai',
|
|
'@modelcontextprotocol/ext-apps',
|
|
'uuid',
|
|
].join('|');
|
|
|
|
export default {
|
|
collectCoverageFrom: ['src/**/*.{js,jsx,ts,tsx}', '!<rootDir>/node_modules/'],
|
|
coveragePathIgnorePatterns: ['/node_modules/', '/dist/'],
|
|
testPathIgnorePatterns: [
|
|
'/node_modules/',
|
|
'/dist/',
|
|
'\\.dev\\.ts$',
|
|
'\\.helper\\.ts$',
|
|
'\\.helper\\.d\\.ts$',
|
|
'/__tests__/helpers/',
|
|
'\\.manual\\.spec\\.[jt]sx?$',
|
|
],
|
|
coverageReporters: ['text', 'cobertura'],
|
|
testResultsProcessor: 'jest-junit',
|
|
transform: {
|
|
'\\.[jt]sx?$': [
|
|
'babel-jest',
|
|
{
|
|
presets: [
|
|
['@babel/preset-env', { targets: { node: 'current' } }],
|
|
'@babel/preset-typescript',
|
|
],
|
|
},
|
|
],
|
|
},
|
|
transformIgnorePatterns: [`/node_modules/(?!(${esModules})/).*/`],
|
|
moduleNameMapper: {
|
|
'^@src/(.*)$': '<rootDir>/src/$1',
|
|
'~/(.*)': '<rootDir>/src/$1',
|
|
},
|
|
// coverageThreshold: {
|
|
// global: {
|
|
// statements: 58,
|
|
// branches: 49,
|
|
// functions: 50,
|
|
// lines: 57,
|
|
// },
|
|
// },
|
|
setupFiles: ['<rootDir>/jest.setup.cjs'],
|
|
maxWorkers: '50%',
|
|
restoreMocks: true,
|
|
testTimeout: 15000,
|
|
};
|