Skip to main content
Glama

3D Asset Processing MCP

by GeoLibra
cache.test.ts2.2 kB
import { CacheManager } from '../../utils/cache'; describe('CacheManager', () => { let cacheManager: any; beforeEach(() => { cacheManager = new CacheManager({ stdTTL: 60, // 1 minute for tests maxKeys: 100 }); }); test('should set and get cache values', () => { const key = 'test-key'; const value = { data: 'test-value' }; cacheManager.set(key, value); const result = cacheManager.get(key); expect(result).toEqual(value); }); test('should generate consistent cache keys', () => { const prefix = 'test'; const data = { id: 123, name: 'test-data' }; const key1 = cacheManager.generateKey(prefix, data); const key2 = cacheManager.generateKey(prefix, data); expect(key1).toBe(key2); }); test('should return null for non-existent keys', () => { const key = 'non-existent-key'; const result = cacheManager.get(key); expect(result).toBeNull(); }); test('should delete cache entries', () => { const key = 'delete-test-key'; const value = { data: 'delete-test-value' }; cacheManager.set(key, value); expect(cacheManager.get(key)).toEqual(value); cacheManager.del(key); expect(cacheManager.get(key)).toBeNull(); }); test('should check if key exists', () => { const key = 'exists-test-key'; const value = { data: 'exists-test-value' }; expect(cacheManager.has(key)).toBe(false); cacheManager.set(key, value); expect(cacheManager.has(key)).toBe(true); }); test('should flush all cache entries', () => { const keys = ['flush-1', 'flush-2', 'flush-3']; const value = { data: 'flush-test-value' }; keys.forEach(key => cacheManager.set(key, value)); keys.forEach(key => expect(cacheManager.has(key)).toBe(true)); cacheManager.flush(); keys.forEach(key => expect(cacheManager.has(key)).toBe(false)); }); test('should return cache statistics', () => { const stats = cacheManager.getStats(); expect(stats).toHaveProperty('keys'); expect(stats).toHaveProperty('hits'); expect(stats).toHaveProperty('misses'); expect(stats).toHaveProperty('hitRate'); expect(stats).toHaveProperty('memoryUsage'); }); });

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/GeoLibra/3d-asset-processing-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server