fix: resolve TypeScript errors in test files
- 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 <noreply@anthropic.com>
This commit is contained in:
@@ -16,7 +16,7 @@ describe('ConsoleManager', () => {
|
|||||||
// Clean up after each test
|
// Clean up after each test
|
||||||
manager.restore();
|
manager.restore();
|
||||||
if (originalEnv !== undefined) {
|
if (originalEnv !== undefined) {
|
||||||
process.env.MCP_MODE = originalEnv;
|
process.env.MCP_MODE = originalEnv as "test" | "http" | "stdio" | undefined;
|
||||||
} else {
|
} else {
|
||||||
delete process.env.MCP_MODE;
|
delete process.env.MCP_MODE;
|
||||||
}
|
}
|
||||||
@@ -250,7 +250,7 @@ describe('ConsoleManager', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
test('should handle empty MCP_MODE', () => {
|
test('should handle empty MCP_MODE', () => {
|
||||||
process.env.MCP_MODE = '';
|
process.env.MCP_MODE = '' as any;
|
||||||
|
|
||||||
const originalLog = console.log;
|
const originalLog = console.log;
|
||||||
|
|
||||||
|
|||||||
@@ -529,14 +529,14 @@ describe('FixedCollectionValidator', () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
// Add prototype property (should be ignored by hasOwnProperty check)
|
// Add prototype property (should be ignored by hasOwnProperty check)
|
||||||
Object.prototype.maliciousProperty = 'evil';
|
(Object.prototype as any).maliciousProperty = 'evil';
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const result = FixedCollectionValidator.validate('switch', config);
|
const result = FixedCollectionValidator.validate('switch', config);
|
||||||
expect(result.isValid).toBe(false);
|
expect(result.isValid).toBe(false);
|
||||||
expect(result.errors).toHaveLength(2);
|
expect(result.errors).toHaveLength(2);
|
||||||
} finally {
|
} finally {
|
||||||
delete Object.prototype.maliciousProperty;
|
delete (Object.prototype as any).maliciousProperty;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user