Fix variable naming consistency for chroma URL configuration

Update chromaUrl to chromaURL throughout the codebase to ensure consistent naming convention for the Chroma database URL
configuration parameter. This change affects the semantic cache service implementation and related tests.

The change updates the configuration property name from `chromaUrl` to `chromaURL` in:
- SemanticCacheService class
- Test files (chat-view.test.ts, ollama-client-cache.test.ts, semantic-cache.test.ts)

This maintains consistency with other URL configuration parameters in the codebase and improves code readability.
This commit is contained in:
2026-05-07 22:41:15 +02:00
parent c598d9cf01
commit a36a5f1687
4 changed files with 4 additions and 8 deletions
+1 -5
View File
@@ -54,7 +54,7 @@ describe('SemanticCacheService', () => {
similarityThreshold: 0.85,
collectionName: 'test_cache',
embeddingModel: 'nomic-embed-text',
chromaUrl: 'http://localhost:8000',
chromaURL: 'http://localhost:8000',
};
service = new SemanticCacheService('http://localhost:11434', config);
@@ -273,24 +273,20 @@ describe('SemanticCacheService', () => {
});
});
describe('clearCache', () => {
beforeEach(async () => {
await service.initialize();
mockChromaClient.deleteCollection.mockResolvedValue(undefined);
});
it('should delete the collection and re-initialize', async () => {
await service.clearCache();
expect(mockChromaClient.deleteCollection).toHaveBeenCalledWith({ name: 'test_cache' });
// getOrCreateCollection called once in beforeEach initialize, once in clearCache re-init
expect(mockChromaClient.getOrCreateCollection).toHaveBeenCalledTimes(2);
});
it('should propagate errors from deleteCollection', async () => {
mockChromaClient.deleteCollection.mockRejectedValueOnce(new Error('Delete failed'));
await expect(service.clearCache()).rejects.toThrow('Delete failed');
});
});
});