Skip to main content
Glama
diagnostics-manager.test.ts1.48 kB
import { describe, it, beforeEach } from 'node:test'; import assert from 'node:assert'; import { DiagnosticsManager } from '../src/diagnostics-manager.js'; import { LSPClient } from '../src/lsp-client.js'; describe('DiagnosticsManager', () => { let lspClient: LSPClient; let diagnosticsManager: DiagnosticsManager; beforeEach(() => { lspClient = new LSPClient(); diagnosticsManager = new DiagnosticsManager(lspClient); diagnosticsManager.setWorkspace('/fake/workspace'); }); describe('getFileDiagnostics', () => { it('should reject paths outside workspace', async () => { await assert.rejects( diagnosticsManager.getFileDiagnostics('../../../etc/passwd'), /File path must be within workspace/ ); }); it('should reject absolute paths outside workspace', async () => { await assert.rejects( diagnosticsManager.getFileDiagnostics('/etc/passwd'), /File path must be within workspace/ ); }); it('should reject paths with .. traversal', async () => { await assert.rejects( diagnosticsManager.getFileDiagnostics('/fake/workspace/../outside/file.gd'), /File path must be within workspace/ ); }); it('should reject when workspace not set', async () => { const manager = new DiagnosticsManager(lspClient); await assert.rejects( manager.getFileDiagnostics('/any/path.gd'), /Workspace path not set/ ); }); }); });

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/ryanmazzolini/minimal-godot-mcp'

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