ci: Mock getAppConfig in various tests to provide default configurations

This commit is contained in:
Danny Avila 2025-08-17 19:39:22 -04:00
parent 2501d11fa0
commit b2b2aee945
No known key found for this signature in database
GPG key ID: BF31EEB2C5CA0956
7 changed files with 150 additions and 23 deletions

View file

@ -2,6 +2,14 @@ const { Constants } = require('librechat-data-provider');
const { initializeFakeClient } = require('./FakeClient');
jest.mock('~/db/connect');
jest.mock('~/server/services/Config', () => ({
getAppConfig: jest.fn().mockResolvedValue({
// Default app config for tests
paths: { uploads: '/tmp' },
fileStrategy: 'local',
memory: { disabled: false },
}),
}));
jest.mock('~/models', () => ({
User: jest.fn(),
Key: jest.fn(),