Skip to main content
Glama

Smart Code Reviewer

by renjismzy
refactoringSuggester.test.ts731 B
import { suggestRefactoring } from '../src/tools/refactoringSuggester'; describe('suggestRefactoring', () => { it('should suggest refactorings for JavaScript code', async () => { const code = ` function example() { var x = 1 + 2; return x; } `; const result = await suggestRefactoring(code, 'javascript', 'all'); expect(result.totalSuggestions).toBeGreaterThan(0); expect(result.suggestions.some(s => s.title === '使用现代变量声明')).toBe(true); }); it('should handle Python code', async () => { const code = `def example(): x = 1 + 2 return x`; const result = await suggestRefactoring(code, 'python'); expect(result.totalSuggestions).toBe(2); }); });

Latest Blog Posts

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/renjismzy/mcp-code'

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