From 296bf76e682ed8adf7489e08ef3e11a66555bdf6 Mon Sep 17 00:00:00 2001 From: czlonkowski <56956555+czlonkowski@users.noreply.github.com> Date: Sat, 2 Aug 2025 10:27:45 +0200 Subject: [PATCH] fix: resolve TypeScript errors in test files MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Fixed MCP_MODE type assignment in console-manager.test.ts - Fixed prototype pollution test TypeScript errors in fixed-collection-validator.test.ts - All linting checks now pass 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- tests/unit/utils/console-manager.test.ts | 4 ++-- tests/unit/utils/fixed-collection-validator.test.ts | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/unit/utils/console-manager.test.ts b/tests/unit/utils/console-manager.test.ts index 46df438..cc721aa 100644 --- a/tests/unit/utils/console-manager.test.ts +++ b/tests/unit/utils/console-manager.test.ts @@ -16,7 +16,7 @@ describe('ConsoleManager', () => { // Clean up after each test manager.restore(); if (originalEnv !== undefined) { - process.env.MCP_MODE = originalEnv; + process.env.MCP_MODE = originalEnv as "test" | "http" | "stdio" | undefined; } else { delete process.env.MCP_MODE; } @@ -250,7 +250,7 @@ describe('ConsoleManager', () => { }); test('should handle empty MCP_MODE', () => { - process.env.MCP_MODE = ''; + process.env.MCP_MODE = '' as any; const originalLog = console.log; diff --git a/tests/unit/utils/fixed-collection-validator.test.ts b/tests/unit/utils/fixed-collection-validator.test.ts index 4b9b494..4196807 100644 --- a/tests/unit/utils/fixed-collection-validator.test.ts +++ b/tests/unit/utils/fixed-collection-validator.test.ts @@ -529,14 +529,14 @@ describe('FixedCollectionValidator', () => { }; // Add prototype property (should be ignored by hasOwnProperty check) - Object.prototype.maliciousProperty = 'evil'; + (Object.prototype as any).maliciousProperty = 'evil'; try { const result = FixedCollectionValidator.validate('switch', config); expect(result.isValid).toBe(false); expect(result.errors).toHaveLength(2); } finally { - delete Object.prototype.maliciousProperty; + delete (Object.prototype as any).maliciousProperty; } });