mirror of
https://github.com/danny-avila/LibreChat.git
synced 2026-08-04 14:57:42 +00:00
test: mock Schedules service in UserController specs (CI shard fix)
UserController now requires ~/server/services/Schedules for quiesceUserSchedules; that pulls the real service chain into UserController specs that mock a partial data-provider (missing ViolationTypes), failing 'api' shards 2/3 at load. Mock the service in the four UserController specs that lacked it, matching deleteUser.spec.
This commit is contained in:
parent
5f094cefe6
commit
76dc1aef5a
4 changed files with 16 additions and 0 deletions
|
|
@ -1,6 +1,10 @@
|
|||
const mongoose = require('mongoose');
|
||||
const { MongoMemoryServer } = require('mongodb-memory-server');
|
||||
|
||||
jest.mock('~/server/services/Schedules', () => ({
|
||||
quiesceUserSchedules: jest.fn().mockResolvedValue(undefined),
|
||||
}));
|
||||
|
||||
jest.mock('@librechat/data-schemas', () => {
|
||||
const actual = jest.requireActual('@librechat/data-schemas');
|
||||
return {
|
||||
|
|
|
|||
|
|
@ -8,6 +8,10 @@ const mockGetMCPManager = jest.fn();
|
|||
const mockGetFlowStateManager = jest.fn();
|
||||
const mockGetMCPServersRegistry = jest.fn();
|
||||
|
||||
jest.mock('~/server/services/Schedules', () => ({
|
||||
quiesceUserSchedules: jest.fn().mockResolvedValue(undefined),
|
||||
}));
|
||||
|
||||
jest.mock('@librechat/data-schemas', () => ({
|
||||
logger: { error: jest.fn(), info: jest.fn(), warn: jest.fn() },
|
||||
getTenantId: jest.fn(),
|
||||
|
|
|
|||
|
|
@ -1,6 +1,10 @@
|
|||
const mockGetMCPManager = jest.fn();
|
||||
const mockInvalidateCachedTools = jest.fn();
|
||||
|
||||
jest.mock('~/server/services/Schedules', () => ({
|
||||
quiesceUserSchedules: jest.fn().mockResolvedValue(undefined),
|
||||
}));
|
||||
|
||||
jest.mock('~/config', () => ({
|
||||
getMCPManager: (...args) => mockGetMCPManager(...args),
|
||||
getFlowStateManager: jest.fn(),
|
||||
|
|
|
|||
|
|
@ -15,6 +15,10 @@ const mockLoggerWarn = jest.fn();
|
|||
const mockLoggerError = jest.fn();
|
||||
const mockGetTenantId = jest.fn();
|
||||
|
||||
jest.mock('~/server/services/Schedules', () => ({
|
||||
quiesceUserSchedules: jest.fn().mockResolvedValue(undefined),
|
||||
}));
|
||||
|
||||
jest.mock('@librechat/data-schemas', () => ({
|
||||
logger: { info: mockLoggerInfo, warn: mockLoggerWarn, error: mockLoggerError },
|
||||
getTenantId: (...args) => mockGetTenantId(...args),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue