mirror of
https://github.com/tiennm99/ccs.git
synced 2026-07-16 04:18:05 +00:00
fix(cliproxy): fix base-config-loader __dirname path and stale mock.module paths
- base-config-loader.ts moved from src/cliproxy/ to src/cliproxy/config/, so __dirname relative path needs one more .. to reach config/ dir - Update mock.module paths for proxy-detector and routing-strategy in non-colocated test files
This commit is contained in:
@@ -33,7 +33,7 @@ const configCache: Map<CLIProxyProvider, BaseSettings> = new Map();
|
||||
function getBaseConfigPath(provider: CLIProxyProvider): string {
|
||||
// __dirname points to dist/cliproxy at runtime
|
||||
// Config files are at package root: ../config/
|
||||
const configDir = path.join(__dirname, '..', '..', 'config');
|
||||
const configDir = path.join(__dirname, '..', '..', '..', 'config');
|
||||
return path.join(configDir, `base-${provider}.settings.json`);
|
||||
}
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ import type { ProxyStatus } from '../../../src/cliproxy/proxy/proxy-detector';
|
||||
// Mutable holder so each test can override the resolved value
|
||||
let mockStatus: ProxyStatus = { running: false, verified: false };
|
||||
|
||||
mock.module('../../../src/cliproxy/proxy-detector', () => ({
|
||||
mock.module('../../../src/cliproxy/proxy/proxy-detector', () => ({
|
||||
detectRunningProxy: async () => mockStatus,
|
||||
waitForProxyHealthy: async () => false,
|
||||
reclaimOrphanedProxy: () => null,
|
||||
|
||||
@@ -42,7 +42,7 @@ describe('cliproxy routing routes', () => {
|
||||
applied: 'config-only',
|
||||
}));
|
||||
|
||||
mock.module('../../../src/cliproxy/routing-strategy', () => ({
|
||||
mock.module('../../../src/cliproxy/routing/routing-strategy', () => ({
|
||||
readCliproxyRoutingState: readStateMock,
|
||||
applyCliproxyRoutingStrategy: applyStrategyMock,
|
||||
readCliproxySessionAffinityState: readAffinityStateMock,
|
||||
|
||||
Reference in New Issue
Block a user