mirror of
https://github.com/tiennm99/ccs.git
synced 2026-07-15 22:21:20 +00:00
- add dependency injection to export-command, binary-manager, codex-plan-compatibility, config-command, and usage-syncer - override process.exit in api-export test to prevent silent termination in Bun's parallel test runner - harden test-environment bootstrap with process.env isolation - fix auth middleware to avoid config upgrade during checks
34 lines
911 B
TypeScript
34 lines
911 B
TypeScript
import { describe, expect, it } from 'bun:test';
|
|
import { CLIPROXY_DEFAULT_PORT } from '../../../src/cliproxy/config/port-manager';
|
|
import { resolveLifecyclePort } from '../../../src/commands/cliproxy/resolve-lifecycle-port';
|
|
|
|
describe('resolveLifecyclePort', () => {
|
|
it('uses configured cliproxy_server.local.port', () => {
|
|
expect(
|
|
resolveLifecyclePort({
|
|
cliproxy_server: {
|
|
local: {
|
|
port: 9456,
|
|
},
|
|
},
|
|
})
|
|
).toBe(9456);
|
|
});
|
|
|
|
it('falls back to default port when configured local port is invalid', () => {
|
|
expect(
|
|
resolveLifecyclePort({
|
|
cliproxy_server: {
|
|
local: {
|
|
port: 70000,
|
|
},
|
|
},
|
|
})
|
|
).toBe(CLIPROXY_DEFAULT_PORT);
|
|
});
|
|
|
|
it('falls back to default port when config file is missing', () => {
|
|
expect(resolveLifecyclePort({})).toBe(CLIPROXY_DEFAULT_PORT);
|
|
});
|
|
});
|