Skip to content

Enhanced ChatGPT Clone: Features Agents, MCP, Skills, DeepSeek, Anthropic, AWS, OpenAI, Responses API, Azure, Groq, o1, GPT-5, Mistral, OpenRouter, Vertex AI, Gemini, Artifacts, AI model switching, message search, Code Interpreter, langchain, DALL-E-3, OpenAPI Actions, Functions, Secure Multi-User Auth, Presets, open-source for self-hosting. Active

🗝️ chore: Use Element Access over `any`-Casts in Registry Cache Spec (#13664)

Danny Avila7a8a18f07d4e
diff --git a/packages/api/src/mcp/registry/cache/__tests__/ServerConfigsCacheRedisAggregateKey.cache_integration.spec.ts b/packages/api/src/mcp/registry/cache/__tests__/ServerConfigsCacheRedisAggregateKey.cache_integration.spec.ts
index eff9adb7df..2cc7f159ed 100644
--- a/packages/api/src/mcp/registry/cache/__tests__/ServerConfigsCacheRedisAggregateKey.cache_integration.spec.ts
+++ b/packages/api/src/mcp/registry/cache/__tests__/ServerConfigsCacheRedisAggregateKey.cache_integration.spec.ts
@@ -254,8 +254,7 @@ describe('ServerConfigsCacheRedisAggregateKey Integration Tests', () => {
await cache.getAll();
// Spy on the underlying Keyv cache to count Redis calls
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
- const cacheGetSpy = jest.spyOn((cache as any).cache, 'get');
+ const cacheGetSpy = jest.spyOn(cache['cache'], 'get');
await cache.getAll();
await cache.getAll();
@@ -325,11 +324,9 @@ describe('ServerConfigsCacheRedisAggregateKey Integration Tests', () => {
await cache.getAll(); // prime snapshot
// Force-expire the snapshot without sleeping
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
- (cache as any).localSnapshotExpiry = Date.now() - 1;
+ cache['localSnapshotExpiry'] = Date.now() - 1;
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
- const cacheGetSpy = jest.spyOn((cache as any).cache, 'get');
+ const cacheGetSpy = jest.spyOn(cache['cache'], 'get');
const result = await cache.getAll();
expect(cacheGetSpy.mock.calls).toHaveLength(1);
expect(Object.keys(result).length).toBe(1);