mirror of
https://github.com/danny-avila/LibreChat.git
synced 2026-07-10 08:13:46 +00:00
* ⬆️ chore: Migrate off deprecated @ariakit/react-core to @ariakit/react-components @ariakit/react-core and its dependency @ariakit/core are deprecated (split into successor packages) and emit install-time warnings. @ariakit/react already ships the non-deprecated @ariakit/react-components transitively; the only direct use of react-core was the SelectRenderer deep import in ControlCombobox, which is now sourced from @ariakit/react-components/select/select-renderer (identical symbol and subpath). Both deprecated packages drop out of the lockfile and react-components dedupes to the single version @ariakit/react pins. * ✅ test: Resolve ESM-only @ariakit split packages in jest @ariakit/react-components and its peers are ESM-only (type: module) and declare only an import export condition, so jest's CJS resolver can't load them when @librechat/client's CJS build requires SelectRenderer. Add a custom jest resolver that resolves these @ariakit/* split packages with the import condition, and extend transformIgnorePatterns so babel transpiles them to CJS. Applied to both the client and packages/client jest configs.
33 lines
1.1 KiB
JavaScript
33 lines
1.1 KiB
JavaScript
export default {
|
|
collectCoverageFrom: ['src/**/*.{js,jsx,ts,tsx}', '!<rootDir>/node_modules/'],
|
|
coveragePathIgnorePatterns: ['/node_modules/', '/dist/'],
|
|
coverageReporters: ['text', 'cobertura'],
|
|
testResultsProcessor: 'jest-junit',
|
|
moduleNameMapper: {
|
|
'^@src/(.*)$': '<rootDir>/src/$1',
|
|
'^~/(.*)$': '<rootDir>/src/$1',
|
|
'\\.(css|less|scss|sass)$': 'identity-obj-proxy',
|
|
},
|
|
// coverageThreshold: {
|
|
// global: {
|
|
// statements: 58,
|
|
// branches: 49,
|
|
// functions: 50,
|
|
// lines: 57,
|
|
// },
|
|
// },
|
|
maxWorkers: '50%',
|
|
restoreMocks: true,
|
|
testTimeout: 15000,
|
|
// React component testing requires jsdom environment
|
|
testEnvironment: 'jsdom',
|
|
testEnvironmentOptions: { url: 'http://localhost:3080' },
|
|
resolver: '<rootDir>/jest.resolver.cjs',
|
|
transform: {
|
|
'^.+\\.(ts|tsx|js|jsx)$': 'babel-jest',
|
|
},
|
|
transformIgnorePatterns: [
|
|
'node_modules/(?!(@tanstack|lucide-react|@dicebear|@ariakit/react-components|@ariakit/react-utils|@ariakit/react-store|@ariakit/components|@ariakit/store|@ariakit/utils)/)',
|
|
],
|
|
setupFilesAfterEnv: ['<rootDir>/jest.setup.ts'],
|
|
};
|