test(cliproxy): assert routing persistence via unified config loader

The previous assertion read the generated CLIProxy config.yaml directly via
getConfigPathForPort(). On the self-hosted CI runner this produced ENOENT even
though applyCliproxyRoutingStrategy returned 'config-only', indicating the
read path and write path diverged in the full test-suite context.

Verify persistence via loadUnifiedConfig() instead — that's the canonical
source mutateUnifiedConfig writes to, independent of regenerateConfig's
file-path resolution.
This commit is contained in:
Tam Nhu Tran
2026-04-19 15:27:24 -04:00
parent e25d791d9b
commit 485fe4ba1c
+3 -5
View File
@@ -116,11 +116,9 @@ describe('cliproxy routing strategy service', () => {
expect(result.applied).toBe('config-only');
expect(result.strategy).toBe('fill-first');
const { getConfigPathForPort } = await import('../../../src/cliproxy/config/path-resolver');
const configPath = getConfigPathForPort(routingTarget.port);
const configContent = fs.readFileSync(configPath, 'utf8');
expect(configContent).toContain('routing:');
expect(configContent).toContain('strategy: fill-first');
const { loadUnifiedConfig } = await import('../../../src/config/unified-config-loader');
const persisted = loadUnifiedConfig();
expect(persisted?.cliproxy?.routing?.strategy).toBe('fill-first');
});
});