mirror of
https://github.com/tiennm99/ccs.git
synced 2026-10-13 20:14:34 +00:00
fix(image-analysis): tolerate missing auth init dependency
This commit is contained in:
1 parent
270810c06e
commit
2f02ddfb74
3 files changed
+23
-1
No files matched your search
@@ -88,6 +88,25 @@ describe('image-analysis-runtime-status', () => {
|
||||
expect(status.effectiveRuntimeMode).toBe('cliproxy-image-analysis');
|
||||
});
|
||||
|
||||
it('uses getAuthStatus when initializeAccounts is omitted from an override', async () => {
|
||||
const status = await hydrateImageAnalysisRuntimeStatus(createStatus(), {
|
||||
getProxyTarget: () => ({ host: '127.0.0.1', port: 8317, protocol: 'http', isRemote: false }),
|
||||
initializeAccounts: undefined as unknown as () => void,
|
||||
getAuthStatus: () => ({
|
||||
provider: 'ghcp',
|
||||
authenticated: true,
|
||||
tokenDir: '/tmp/auth',
|
||||
tokenFiles: ['github-copilot-test.json'],
|
||||
accounts: [],
|
||||
defaultAccount: undefined,
|
||||
}),
|
||||
isCliproxyRunning: async () => true,
|
||||
});
|
||||
|
||||
expect(status.authReadiness).toBe('ready');
|
||||
expect(status.effectiveRuntimeMode).toBe('cliproxy-image-analysis');
|
||||
});
|
||||
|
||||
it('treats an unreachable remote proxy as unavailable', async () => {
|
||||
const status = await hydrateImageAnalysisRuntimeStatus(createStatus(), {
|
||||
getProxyTarget: () => ({
|
||||
|
||||
Reference in new issue
Block a user